My high school history teacher had a plan for a book that he would call "Hemorrhoids in History," about seemingly inconsequential things that would actually have significant historical effects. Sounds fascinating, right?
The basis for this title was that Napoleon's hemorrhoids flared up during the Battle of Waterloo, he retired from the field to seek treatment, and the general who took over proceeded to lose the battle. The resulting change in the balance of power of Europe would set the stage for WWI a century later, which led directly to WWII, and the Cold War. Since he was of the Baby Boomer generation, his hypothesis was that his generation existed as a result of WWII, therefore he was born as a direct result of Napoleon's hemorrhoids.
Is there any truth to the story of Napoleon being removed from the battlefield because of his hemorrhoids?
Assuming your High School teacher was called Phil Mason he actually went ahead and wrote this book in 2008. Unfortunately for him I have significant doubts about the truth behind this claim. I don't have a copy of the book so I can't critique him directly but a quick Google search reveals his claim goes something along the lines of Napoleon delayed the start of the battle because his hemorrhoids were playing up which allowed Wellington to hold out until the Prussians arrived. This is unlikely to be true as Napoleon was up, dressed and on a horse at least four hours before the battle began. A more generally accepted explanation for the delay is that Napoleon wished to wait for the ground to dry out so the artillery could fire without sinking into the mud and to make it easier for his cavalry to manoeuvre.
While searching I found this website which seems to correspond with what you say in the post, saying that Napoleon "famously" left the field at 2pm and was thus unable to halt Marshall Ney's disastrous cavalry attack. I can find absolutely no evidence for this "famous" event and even if it was true Ney's attack took place at about 4pm and it's very unlikely that Napoleon would be completely absent from a battle of this scale for two whole hours. The whole idea of Napoleon's hemorrhoids being a decisive factor was most likely fabricated by Napoleon apologists who wished to blame his defeat on literally anything but the man himself.