Both shaving (halq) and trimming (taqsir) are valid for men, but shaving is clearly preferred. نبی کریم (صلی اللہ علیہ وسلم) prayed three times for those who shave their heads and once for those who trim, when the companions asked about the virtue of each. Shaving involves removing all hair from the head, while trimming means cutting at least a fingertip's length (approximately 2 cm) from all areas of the hair — not just the tips.
For women, shaving is NOT permitted. Women perform taqsir only — gathering their hair and cutting approximately a fingertip's length from the ends. This applies regardless of hair length or style. A woman who shaves her head would be going against the Sunnah.
In the حج ritual sequence on the 10th of Dhul Hijjah, the shaving/trimming comes after the stoning of جمرات al-Aqabah and the animal sacrifice (for those who must sacrifice). Once you shave or trim, you enter the first stage of exiting احرام (tahallul al-awal): everything that was prohibited during احرام becomes permissible again EXCEPT sexual relations with your spouse. After performing طواف al-Ifadah and سعی, you enter the second stage of tahallul (tahallul al-thani), and all restrictions are lifted. Barber services are widely available in منیٰ and مکہ مکرمہ — many حجاج use the free or low-cost barber services near the جمرات area.