Ibn al-Qayyim said, “Indeed when Allaah intends good for a servant, He strips away sight of his good deeds from his heart, and their mention from his tongue, and causes him to become preoccupied with his sins, and they continue to be before his eyes until he enters Paradise. For indeed, those actions which have been accepted–the sight of them is removed from the heart and their remembrance from the tongue.

And one of the Salaf said, ‘Indeed the servant commits a mistake by which he enters Paradise. And he performs a good deed by which he enters the Fire.’

They said, ‘How so?’

He said, ‘He commits a mistake and so it remains before his eyes. When he recalls it he regrets it, resigns [himself to] and earnestly implores Allaah, and hastens to erase it, and he becomes broken and humble before his Lord, and his self-amazement and arrogance disappears. And he will perform a good deed and it will remain before his eyes, he sees it and uses it as a favour, and becomes self-conceited because of it, becomes arrogant because of it, until he enters the Fire.’”

Ar-Risaalah at-Tabukiyyah, vol. 1, p. 74.