The Prophet ﷺ said, "When one of you acquires a wife, a servant, or a riding animal, let him take hold of its forelock and say, 'O Allah, I ask You for the good of her and the good of the nature You have given her, and I seek refuge in You from her evil and the evil of the nature You have given her.'"
حدثنا محمد بن يحيى وصالح بن محمد بن يحيى القطان قالا حدثنا عبيد الله بن موسى حدثنا سفيان عن محمد بن عجلان عن عمرو بن شعيب عن أبيه
عن النبي ﷺ قال إذا أفاد أحدكم امرأة أو خادما أو دابة فليأخذ بناصيتها وليقل اللهم إني أسألك من خيرها وخير ما جبلت عليه وأعوذ بك من شرها وشر ما جبلت عليه
[Its chain of transmission is hasan]. Abu Dawud narrated it in the Book of Marriage, chapter on comprehensive rulings on marriage, hadith no. 2160, from the hadith of Ibn Ajlan, through this route, and Hakim graded it sahih, as did Dhahabi. Ibn Ajlan explicitly stated that he heard it directly, as recorded by Bukhari in Khalq Afal Abbad.