The Prophet ﷺ said, "Allah has forgiven my followers the evil thoughts that occur to their minds, as long as such thoughts are not put into action or uttered."
عَنِ النَّبِيِّ ﷺ قَالَ إِنَّ اللَّهَ تَجَاوَزَ عَنْ أُمَّتِي مَا حَدَّثَتْ بِهِ أَنْفُسَهَا مَا لَمْ تَعْمَلْ أَوْ تَتَكَلَّمْ