Short answer

Angels write down every deed, and God (﷾) counts them with great mercy. The Prophet (ﷺ) explained how. If you intend a good deed but do not do it, one good deed is written for you. If you do it, it is written as ten good deeds, up to seven hundred or many more. If you intend a bad deed but hold back for God's (﷾) sake, a good deed is written for you. If you do it, only one bad deed is written, or God (﷾) may wipe it out. So good is multiplied, and evil is not. A passing bad thought is forgiven, as long as you do not speak of it or act on it. The Qur'an adds that good deeds remove bad ones. For those who repent, believe and do good, God (﷾) changes their bad deeds into good ones.

Read the full explanation

See your saved pages