The udḥiyah is valid only after the ʿĪd prayer. The Prophet ﷺ said: “The first thing we do on this day is pray, then return and sacrifice. Whoever does so has followed our Sunnah; whoever slaughtered before, it is only meat he offered his family.” (al-Bukhārī & Muslim).

العربية: عن البراء بن عازب رضي الله عنه أنّ النبيّ ﷺ قال: «إنّ أوّل ما نبدأ به في يومنا هذا أن نُصلّي، ثم نرجع فننحر، فمن فعل ذلك فقد أصاب سنّتنا، ومن ذبح قبل فإنما هو لحمٌ قدّمه لأهله». (البخاري ومسلم).

On ʿĪd al‑Aḍḥā, pray first — then slaughter your sacrifice.