Messenger of Allah ﷺ said : "Allah has forgiven my nation for the evil suggestions of their hearts, so long as they do not act upon it or speak of it, and for what they are forced to do." (Using translation from Ibn Mājah 2044)
"إِنَّ الله تجَاوَزِ لأُمَّتى عَمَّا تُوَسْوسُ به صُدُورهُم ما لمْ تعْمَلْ أَوْ تتكلّمْ به، وَمَا اسْتُكْرهُوا عليه" .