If a depressing thought of some sin we committed comes to our mind, check if we have confessed that sin to God.
Bible clearly states in 1 John 1:9 – 9 If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness.
If we confess our sins, God surely will forgive our sins. After forgiving our sins, God will not accuse us for that sin. So definitely realise that the accusation is from devil and reject it. Do not think about it any more.
If it comes to mind again, resist it saying in your mind – I do not accept your accusation satan. Refuse to think about it any more. Divert your attention to something good or may be sing a christian praise song.
Bible clearly states in James 4:7 – 7 Submit yourselves therefore to God. Resist the devil, and he will flee from you.