It is Mustahab (recommended) to not cut hair and clip nails when intending to do sacrifice (Udhiya). If one did so they will not be sinful.
However, it is Wajib to clip nails and shave pubic and armpit hair once in forty days. It is not permissible to leave it for forty days or more. So if during the first ten days of Dhul Hijjah, a person’s forty days are up, it will be necessary on him/her to remove the hair and nails. Wajib will take priority over a Mustahab or Sunnah.
ومما ورد في صحيح مسلم قال رسول الله (ص): إذا دخل العشر وأراد بعضكم أن يضحي فلا يأخذن شعرا ولا يقلمن ظفرا فهذا محمول على الندب دون الوجوب بالاجماع…….الأفضل أن يقلم أظفاره ويقص شاربه ويحلق عانته وينظف بدنه بالاغتسال في كل أسبوع وإلا ففي كل خمسة عشر يوما ولا عذر في تركه وراء الأربعين
(ردالمحتار ٢/١٨١،سعيد)