in 9 36 quran says there are four sacred months. In 5 2 Quran refers to the sacred month. Which is it ?
The sacred months are four and they are Rajab, Dhu’l-Qa’dah, Dhu’l-Hijjah and Muharram.
ربعة حرم، ثلاث متواليات، ذو القعدة وذو الحجة والمحرم ورجب
Four of which are sacred. Three of them are in succession; Dhul-Qa'da, Dhul-Hijja and Al-Muharram, and the fourth is Rajab
5:2 does not imply that there is only one sacred month. In the same way that the following verse does not imply that that there is only one man:
ولقد خلقنا الإنسان ونعلم ما توسوس به نفسه ونحن أقرب إليه من حبل الوريد
And We have already created man and know what his soul whispers to him, and We are closer to him than [his] jugular vein
Because referring to a genus or one instance of it does not negate the existence of plural instances. Nowhere does 5:2 say that there is only one sacred month. For 5:2 to contradict 9:36 it needs to say 'only one is sacred' which it does not.
To give some additional examples:
The following verses do not imply that there is only one star:
وبالنجم هم يهتدون
And by the star they find a way.
والنجم إذا هوى
By the star when it descends,
And the following verses do not imply that there is only one angel:
والملك على أرجائها
And the angel will be on its edges.
وجاء ربك والملك صفا صفا
And your Lord has come and the angel, rank upon rank,
And the following verse does not imply that there is only one child:
أو الطفل الذين لم يظهروا على عورات النساء
or the child who is not yet aware of the private aspects of women
And the following verse does not imply that there is only one bone:
إني وهن العظم مني
Surely the bone within me have become feeble
And the following verse does not imply that there is only one wrongdoer:
ويوم يعض الظالم على يديه
And the Day the wrongdoer will bite on his hands