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.