ghayn

غ

The Arabic letter ghayn 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 these words:

rage
ghaDab
غَضَب
twig
ghuSn
غُصن
other
ghayr
غَير

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 this word:

pressure
DaghT
ضَغط

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

ـغ

Now you know that:

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

The letter ghayn 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.

غـ
fluff
zaghab
زَغَب

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: ayn ع Next letter: fa ف