In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Allaah [The Exalted] said: [وَقُلِ ٱلۡحَقُّ مِن رَّبِّكُمۡۖ فَمَن شَآءَ فَلۡيُؤۡمِن وَمَن شَآءَ فَلۡيَكۡفُرۡۚ – And say: “The truth is from your Lord.” Then whosoever wills, let him believe, and whosoever wills, let him disbelieve].
Meaning – O Muhammad! Say to the people: This is the truth from your Lord and certainly He has clearly explained the difference between guidance and misguidance, distinguished between the path of upright conduct and deviation, the traits of those who are blessed and the traits of those who are wretched have been distinguished based on that which Allah has explained through the speech of His Messenger. Therefore, after it has been manifested and made clear, and there remains no ambiguity, then [فَمَن شَآءَ فَلۡيُؤۡمِن وَمَن شَآءَ فَلۡيَكۡفُرۡۚ – Then whosoever wills, let him believe, and whosoever wills, let him disbelieve] – Meaning, nothing remains except to follow one of the two paths based on whether a person is blessed with guidance or not. Indeed, Allah granted a person free will by way of which he can choose between faith and disbelief, and between good and evil; so whoever believes then indeed he has been blessed with what is correct and whoever disbelieves then indeed the proofs have been established against him. There is no compulsion as Allaah stated in another verse:
لَآ إِكۡرَاهَ فِى ٱلدِّينِۖ قَد تَّبَيَّنَ ٱلرُّشۡدُ مِنَ ٱلۡغَىِّۚ فَمَن يَكۡفُرۡ بِٱلطَّـٰغُوتِ وَيُؤۡمِنۢ بِٱللَّهِ فَقَدِ ٱسۡتَمۡسَكَ بِٱلۡعُرۡوَةِ ٱلۡوُثۡقَىٰ لَا ٱنفِصَامَ لَهَاۗ وَٱللَّهُ سَمِيعٌ عَلِيمٌ
There is no compulsion in religion. Verily, the Right Path has become distinct from the wrong path. Whoever disbelieves in Taghut and believes in Allah, then he has grasped the most trustworthy handhold that will never break. And Allah is All-Hearer, All-Knower. [Surah Al-Baqarah. Aayah 256]
And regarding Allaah’s statement, [فَمَن شَآءَ فَلۡيُؤۡمِن وَمَن شَآءَ فَلۡيَكۡفُرۡۚ – Then whosoever wills, let him believe, and whosoever wills, let him disbelieve], this does not mean that one is given permission in both affairs (i.e. belief and disbelief), but rather the statement is a threat and warning to those who choose disbelief after the affair has been explained thoroughly. Then Allaah mentions the final abode of both groups, saying:
إِنَّآ أَعۡتَدۡنَا لِلظَّـٰلِمِينَ نَارًا أَحَاطَ بِہِمۡ سُرَادِقُهَاۚ وَإِن يَسۡتَغِيثُواْ يُغَاثُواْ بِمَآءٍ۬ كَٱلۡمُهۡلِ يَشۡوِى ٱلۡوُجُوهَۚ بِئۡسَ ٱلشَّرَابُ وَسَآءَتۡ مُرۡتَفَقًا
إِنَّ ٱلَّذِينَ ءَامَنُواْ وَعَمِلُواْ ٱلصَّـٰلِحَـٰتِ إِنَّا لَا نُضِيعُ أَجۡرَ مَنۡ أَحۡسَنَ عَمَلاً
أُوْلَـٰٓٮِٕكَ لَهُمۡ جَنَّـٰتُ عَدۡنٍ۬ تَجۡرِى مِن تَحۡتِہِمُ ٱلۡأَنۡہَـٰرُ يُحَلَّوۡنَ فِيہَا مِنۡ أَسَاوِرَ مِن ذَهَبٍ۬ وَيَلۡبَسُونَ ثِيَابًا خُضۡرً۬ا مِّن سُندُسٍ۬ وَإِسۡتَبۡرَقٍ۬ مُّتَّكِـِٔينَ فِيہَا عَلَى ٱلۡأَرَآٮِٕكِۚ نِعۡمَ ٱلثَّوَابُ وَحَسُنَتۡ مُرۡتَفَقً۬ا
Verily, We have prepared for the Zalimun (polytheists and wrong-doers, etc.), a Fire whose walls will be surrounding them. And if they ask for help (relief, water, etc.) they will be granted water like boiling oil, that will scald their faces. Terrible the drink, and an evil Murtafaqa (dwelling, resting place, etc.)! Verily! As for those who believe and do righteous deeds, certainly! We shall not suffer to be lost the reward of anyone who does his (righteous) deeds in the most perfect manner. These! For them will be ‘Adn (Eden) Paradise (everlasting Gardens); wherein rivers flow underneath them, therein they will be adorned with bracelets of gold, and they will wear green garments of fine and thick silk. They will recline therein on raised thrones. How good is the reward, and what an excellent Murtafaqa (dwelling, resting place, etc.)! (1)
Read: On Imaan (Faith) and Kufr (disbelief):
[Ref 1: An Excerpt from Tafsir as-Sadi. Surah Al-Kahf. Verses 29-31. Slightly paraphrased]