Saying bismillah before having intercourse is liked. The saying of bismillah benefits the young man, and protects him from the harm of the devil. The scholars have differed in opinion over the harm which it protects one from.
It has been confirmed in the hadith of the Prophet ﷺ: If anyone of you says Bismillah, Allahumma jannibni-Sh-Shaitan wa jannib-ish-Shaitan ma razaqtana when having sexual intercourse with his wife, then if it is destined that they should have a child, satan will never be able to harm him. Narrated by Bukhari and Muslim.
As for the benefits to the child, the scholars have differed in opinion over the meaning of the saying of the Prophet ﷺ (then satan will never be able to harm him). They include:
1. That shaytan will not have power over the baby but will rather be from among the servants of Allah because of the blessing of “bismillah”. Those whom Allah describes in the Qur’an – “As for My servants, you have no authority over them. Different, however, is the case of such of the deviators who (choose to) follow you) surah Al-Hijr Ayah 42
2. Nothing will harm the child physically
3. It will be a reason for his being saved from committing shirk (associating partners with Allah) and disbelieving
4. It distances him from committing major sins
5. Prevents the presence of shaytan with the couple during intercourse because it has been narrated on the authority of Mujahid that “The ones who have intercourse and do not say bismillah, shaytan wraps around his male sex organ’.
Ibn Hajar says: “These are the possible explanation to the hadith. The first answer is stronger as many people who know the great virtue may forget the words when they have intercourse, and few who have said the basmalah (Bismillah) do not get pregnant.”
And it has come in the book of Ihkam al Ahkam, by Ibn Daqiq Al Eid:
The saying of the Prophet ﷺ “and satan will not harm him” likely means a general meaning of harm which includes religious difficulty comes to him. It can also be taken to mean a specific harm in form of physical harm. Meaning that Satan cannot manipulate him, make him act blindly, or cannot get him to do things which may harm his brain or his body, and this is closer to the actual meaning.
Even though the specificity here contradicts the principle. However, if we take it according to its general indication then we would necessitate this: that the child will be unable to commit any sin, and this is either impossible, or rare. There is no doubt that what the Prophet ﷺ told us is real and would occur as said. In this case, taking it to mean physical and mental harm sounds better and there is not evidence that can prove otherwise.