initial hamzas

These are always carried on an alif. They are still classed as initial when preceded by AL (definite article)

example : أمير

medial hamzas

In order to know how to write the medial hamza, you should consider the "vowel" on the hamza itself and the letter infront of it.

1.) if either or both are a kasra then select the "yaa" shape to carry the hamza.

example : رئيس

2.) if there are no kasras, then if either or both are dhammas choose the waw shape to carry the hamza.

example : شؤون

3.) if both are fathas, choose the alif

example : رأيٌ

final hamzas

Onlythe preceding "vowel" needs to be considered.

1.) if there is sukoon or a long vowel (alif, yaa, waw) infront of the hamza, it needs to be written on the line.
(also two successive alifs are not allowed so if the final letter is alif with fatha, write the hamza on the line)

example : شيء

2.) if the vowel is kasra, choose yaa, if it is dhamma, choose waw in the same way you would with a medial hamza :)