Praise be to Allah.
The Sunnah for one who wants to slaughter the udhiyah is to say when slaughtering it:
Bismillaah, wa Allaahu akbar, Allaahumma haadha minka wa laka, haadha ‘anni (or if it is being offered on behalf of someone else, haadha ‘an [fulaan]), Allaahumma taqabbal min [fulaan] wa aali [fulaan].
(In the name of Allaah, Allaah is most great. O Allaah, this is from You and to You. This is on my behalf (or if it is being offered on behalf of someone else, This is on behalf of [So and so]). O Allaah, accept (this sacrifice) from [So and so] and the family of [So and so]) – here he should mention his name instead of [fulaan] or [So and so].
What is obligatory here is to say Bismillaah; the rest is mustahabb but is not obligatory.
Al-Bukhaari (5565) and Muslim (1966) narrated that Anas said: The Prophet (peace and blessings of Allaah be upon him) sacrificed two horned rams that were white speckled with black. He slaughtered them with his own hand, said Bismillaah and Allaahu akbar, and put his foot on their necks.
Muslim (1967) narrated from ‘Aa’ishah that the Messenger of Allaah (peace and blessings of Allaah be upon him) ordered that a horned ram be brought to him so that he could sacrifice it. He said, “O ‘Aa’ishah, give me the knife.” Then he said, “Sharpen it on a stone.” So she did that, then he took it and took the ram, and he lay it down and prepared to slaughter it. He said, “In the name of Allaah, O Allaah accept (this sacrifice) from Muhammad and the family of Muhammad and the ummah of Muhammad,” then he sacrificed it.
Al-Tirmidhi (1521) narrated that Jaabir ibn ‘Abd-Allaah said: I was present with the Prophet (peace and blessings of Allaah be upon him) on the day of al-Adha at the prayer place. When he had finished his khutbah he came down from his minbar and a ram was brought which the Messenger of Allaah (peace and blessings of Allaah be upon him) slaughtered with his own hand. He said, “In the name of Allaah, Allaah is Most Great. This is on behalf of myself and on behalf of those of my ummah who have not offered a sacrifice.” Classed as saheeh by al-Albaani in Saheeh al-Tirmidhi.
In some reports the words “O Allaah, this is from You and to You” are added. See Irwa’ al-Ghaleel, 1138, 1152.
Allaahumma minka (O Allaah, from You) means this sacrifice is a gift and provision that has reached me from You. Laka (to You) means, it is sincerely for You alone.
See al-Sharh al-Mumti’, 7/492.