Rasūlullāh ﷺ mentions:
“When anyone of you intends to sacrifice the animal and enters in the month of Ḍhul-Ḥijjah, he should not get his hair cut or nails pared till he has offered his sacrifice.” (Muslim 1977)
It is mustahabb (recommended) for the one who intends to sacrifice an animal on ʿīd al-aḍḥā to abstain from clipping nails, having a haircut, and removing hair from the armpits and private parts so that his sacrifice is in accordance with the sunnah.
The pilgrims in Ḥajj have been prohibited from cutting their hair and nails, etc. The wisdom behind the sharīʿah encouraging those who did not perform the pilgrimage to also abstain from such acts, was to imitate the pilgrims [in some actions]; so, the mercies and blessings descending upon them may descend upon them too.
In other words:
فَتَشبّهُوا اِنْ لَمْ تَكُونُوا مِثْلَهُم … انَّ التَشبُّهَ بالكِرام فَلَاحُ
“Resemble them [the pilgrims] if you cannot be like them. Verily the resemblance of the noble ones is also [a form of] success.”