And the weighing [of deeds] that Day will be the truth. So those whose scales are heavy - it is they who will be the successful.
And those whose scales are light - they are the ones who will lose themselves for what injustice they were doing toward Our verses.
[Sūrat al-A'rāf 7:8-9]
Ibn al-Qayyim stated:
Some people may mix a righteous deed with a bad deed, so they commit both good deeds and major sins, and they meet Allāh persisting in that and not having repented from it, but their good deeds outweigh their bad deeds. So when their deeds are weighed, and the good deeds weigh more heavily, they will also be saved and be successful.
Hudhayfah, ‘Abdullāh ibn Mas'ūd and others among the Ṣaḥābah said:
On the Day of Resurrection, the people will be gathered in three categories. Those whose good deeds outweigh their bad deeds, even by one, will enter Paradise. Those whose bad deeds outweigh their good deeds, even by one, will enter Hell. And those whose good deeds and bad deeds are equal will be among the people of the Heights [between Paradise and Hell].
This weighing up of good and bad deeds will come after scores have been settled and those who were wronged have had their rights restored by taking from the good deeds of those who wronged them. Then if any of their good deeds are left, they will be weighed, as will their bad deeds.
Ṭareeq al-Hijratayn (1/562)