Said before intimacy, and what it protects
A second narration with slightly different wording.
لَوْ أَنَّ أَحَدَكُمْ إِذَا أَتَى أَهْلَهُ قَالَ {اللَّهُمَّ} جَنِّبْنِي الشَّيْطَانَ، وَجَنِّبِ الشَّيْطَانَ مَا رَزَقْتَنِي. فَإِنْ كَانَ بَيْنَهُمَا وَلَدٌ لَمْ يَضُرُّهُ الشَّيْطَانُ، وَلَمْ يُسَلَّطْ عَلَيْهِ
Bismillāh, Allāhumma jannibni-sh-shayṭāna wa jannibi-sh-shayṭāna mā razaqtanā.
“In the name of Allah. O Allah, keep Satan away from me, and keep Satan away from what You provide us.”
The full narration
Narrated Ibn `Abbas:The Prophet (ﷺ) said, "If anyone of you, on having sexual relation with his wife, says: 'O Allah! Protect me from Satan, and prevent Satan from approaching the offspring you are going to give me,' and if it happens that the lady conceives a child, Satan will neither harm it nor be given power over it
Source
Ṣaḥīḥ al-Bukhārī · 3283
- Agreed upon as authentic (al-Bukhārī / Muslim)