The Quran describes Hell with fire and pain as a warning to move people towards goodness. It says that Allah does not wrong anyone, and each person is judged by what they knew and did. Many scholars hold that a Muslim who has sinned but kept the faith may be punished and then taken out, or be forgiven outright, and that the sin of associating partners with Allah without repentance is not forgiven.
Muslims believe that no human can know the final fate of any particular person, apart from those the Quran itself names, such as Abu Lahab. The Prophet ﷺ taught that Allah is more merciful than a mother to her child, and that a man was forgiven for giving water to a thirsty dog. Muslims are told never to be sure of anyone's fate.