"The restaurant is expensive."
could you explain why should it be غالٍ ? i find the endings of the adjectives confusing
This is actually because the adjective here is indefinite. There are specific rules in Arabic when it comes to words with a vowel, especially "Y" ي - when such nouns or adjectives come indefinite, the last vowel is omitted and exchanged with Tanwin (of the same flavor of the omitted letter) for easy pronunciation (because indefinite words bear Tanwin usually except in few cases). Examples:
The judge (القاضي) becomes قاضٍ (qáDin) - a judge.
The lawyer (المحامي) becomes محامٍ (muHámin) - a lawyer.
Notice this is a general rule and not applied to adjectives only