This wasn't a pleasant operation as he probably had a bladder stone that was causing him a considerable amount of pain.
The operation was carried out by Thomas Hollier of St Thomas and Barts. Claire Tomalin's biography, 'Samuel Pepys: The Unequalled Self,' gives a well-researched description of this surgery: its risks, the preparations, the surgery itself, and the follow-up care. Here is the gory heart of her account
"The surgeon got to work. First he inserted a thin silver instrument, the itinerarium, through the penis into the bladder to help position the stone. Then he made the incision, about three inches long and a finger's breadth from the line running between scrotum and anus, and into the neck of the bladder, or just below it. The patient's face was sponged as the incision was made. The stone was sought, found and grasped with pincers; the more speedily it could be got out the better. Once out, the wound was not stitched--it was thought best to let it drain and cicatrize itself--but simply washed and covered with a dressing, or even kept open at first with a small roll of soft cloth known as a tent, dipped in egg white. A plaster of egg yolk, rose vinegar and anointing oils was then applied.'
Lucky for him, the stone came out intact. It was the size of a real tennis ball and afterwards Pepys with his wonderful sense of humour had it had it set in a case, which cost him twenty-four shillings. He may have survived because he was first on the day's list to be operated on (so the surgeon's tools and hands were relatively clean), and because the operation was done not at the hospital but at the home of a relative. The incision was about three inches long and the extraction took less than a minute.
For the rest of his life, Pepys celebrated March 26th as the day on which he gave thanks for his many blessings. Here's the entry in the diary for March 26th, 1660.
'This day it is two years since it pleased God that I was cut of the stone at Mrs. Turner’s in Salisbury Court. And did resolve while I live to keep it a festival, as I did the last year at my house, and for ever to have Mrs. Turner and her company with me. But now it pleases God that I am where I am and so prevented to do it openly; only within my soul I can and do rejoice, and bless God, being at this time blessed be his holy name, in as good health as ever I was in my life.'
No wonder, he had an obsession with his health. And, like a good reporter, the date was an opportunity to go into the condition of his body and his ailments. Here is the entry for March 26th, 1665.
' This is the day seven years which, by the blessing of God, I have survived of my being cut of the stone, and am now in very perfect good health and have long been; and though the last winter hath been as hard a winter as any have been these many years, yet I never was better in my life, nor have not, these ten years, gone colder in the summer than I have done all this winter, wearing only a doublet, and a waistcoate cut open on the back; abroad, a cloake and within doors a coate I slipped on. Now I am at a losse to know whether it be my hare’s foot which is my preservative against wind, for I never had a fit of the collique since I wore it, and nothing but wind brings me pain, and the carrying away of wind takes away my pain, or my keeping my back cool; for when I do lie longer than ordinary upon my back in bed, my water the next morning is very hot, or whether it be my taking of a pill of turpentine every morning, which keeps me always loose, or all together, but this I know, with thanks to God Almighty, that I am now as well as ever I can wish or desire to be, having now and then little grudgings of wind, that brings me a little pain, but it is over presently, only I do find that my backe grows very weak, that I cannot stoop to write or tell money without sitting but I have pain for a good while after it. Yet a week or two ago I had one day’s great pain; but it was upon my getting a bruise on one of my testicles, and then I did void two small stones, without pain though, and, upon my going to bed and bearing up of my testicles, I was well the next. But I did observe that my sitting with my back to the fire at the office did then, as it do at all times, make my back ake, and my water hot, and brings me some pain.'
One unfortunate outcome of the operation was that Pepys was probably given a vasectomy at the same time by accident. Of course, we can't be certain, but he never produced any children nor did he report that any of his dalliances became pregnant by him. The lack of children with his wife, Elizabeth, was one of the great sadnesses that haunted his life.