ya

ي

The Arabic letter ya can appear in four different forms: isolated, initial, medial and final.

finalmedialinitialisolated
ـيـيـيـي

When you show the letter on its own, you use the isolated form.

ي

When the letter is the first letter of a word, you use the initial form.

يـ

For example this word:

day
yawm
يَوم

When the letter is not the first and not the last but somewhere in the middle of a word, you use the medial form in most cases.

ـيـ

For example these words:

bag
kiis
كِيس
goodness
khayr
خَير
period
Hiin
حِين

When the letter is the last letter of a word, you use the final form in most cases.

ـي

For example these words:

throwing
ramy
رَمي
any
'ayy
أَيّ

Now you know that:

In most cases...
Let us look at the other cases!

The letter ya has dual joining, like most Arabic letters. It wants to join with both the letter before it and the letter after it.
But some letters has right joining. They only want to join with the letter before it (which is the letter to the right since Arabic is written from right to left).

When the letter is in the middle of a word, and follows a right joining letter, you use the initial form.

يـ
cock
diik
دِيك
tail
dhayl
ذَيل
debt
dayn
دَين

When the letter is the last letter of a word, and follows a right joining letter, you use the isolated form.

ي

Now you know that:

That's it!
The rules you just learned can be applied to all Arabic letters with dual joining, which is most of them.

Previous letter: waw و