Alessandro Moreschi was the last castrato; and the only castrato whose voice is on record (from a gramophone recording of 1902). Prospective castrati were "loosened up" in a hot bath and dosed with opium and/or alcohol. Pressure was applied to the carotid artery to render the boy (ideally) insensible. The procedure was hazardous; and the anaesthesia woefully incomplete. Today such mutilation is normally condemned as barbarous; but it is practised routinely on juvenile non-human farm animals.
The Good Drug Guide
The Abolitionist Project
Refs and Further Reading
Anaesthesia and Anaesthetics
Critique of Aldous Huxley's Brave New World