The hamzah will either be at a word's beginning, middle, or end.
[A hamzah at the beginning is called a hamzah mutaqaddimah. It may be a hamzah qatiʾ or hamzah wasl.]
When the hamzah appears at the beginning - as in: as the first letter of the word - it will always be written in the form of the alif, regardless of whether it is maftūhatan, maksūratan, or madmumatan. e.g. أَحَدَ، أُحُد، و إِبِل.
Likewise, when the لام الابتداء or حرف الجرّ enters upon the hamza at the beginning of a word, e.g. لأفضل، و بإصبع.
EXCEPTIONS: In the words: لِئلَّا، و لَئِنْ where the hamzah is written on the yā, just like that hamzah which appears in the middle of the word is written, due to common usage.
The above discussion is the case when the hamzah is hamzah qat’, and as for when it is a hamzah waṣl: It will be dropped in writing after;
[A hamzah in the middle of a word is called a hamzah mutawassiṭah.]
When the hamza is in the middle - as in it appears in the middle of the word and it
EXCEPTION: When the hamza is maftūhatan and the letter before it is either Madmoom or maksūr; then in that case it will be written on the letter which corresponds to the harakah of the letter before it, e.g. سُؤَال، و مُؤَنَّث، و ذِئَاب.
USAGE: The hamzah of the words مَسْئَلَة، وَ مَسْئُول are written on the letter yaa, which contradicts the rule, and it is correct for the first to be written on an alif like so - مَسْأَلَة , and for the second to be written on a waw like so - مَسْؤُول, and they are also written in this way.
[A hamzah at the end of a word is called a hamzah mutaṭrifah.]
When the hamza is at the edge - as in it appears at the end: If the letter before it is;
When the tā of ta’nīth is attached to it and;
USAGE: The hamzah maftūhah which appears before an alif will be written on an alif, and a madd will be placed on it, like so - آ. This is irrespective of whether it is at the beginning of a word (e.g. آمَنَ، وَ آمِنُ ) , or in the middle of it (e.g. قُرْآن، و شَنَآن، و ظَمْآن ) , or at its end (e.g. ظَمْآى، و سُوَآى، و مَلْآى ).
Muqniʾ fi Maʾrifat Marsūm Maṣāḥif Ahl al-Amsār li Abu Amr al-Dani (d. 444 AH). na. Maktabah Nizam Yaqubi; Bahrayn. pp. 148-169 v. 2
al-Muyassar fi ʿIlm Rasm al-Muṣḥāf wa Ḍabṭihu li Ghānim Qaddūri. 1437/2016. Maʾhad Imam Shatibi, Saudi Arabia. pp. 147-158
Mawārid al-Zam'an li Kharraz (d. 717). 1427/2006. Maktabah Imam Bukhari. Verses 291-337
Kitāb al-Wasīlah ila Kashf al-ʿAqīlah li Abi Hasan Sakhawi (d. 643). 1424/2003. Maktabah Rushd, Saudi Arabia. p. 366