There's an absolutely foolproof trick to doing so if your attempts at not getting one has failed.
Simply flex your thigh muscles (quadriceps) as hard as you can.
What will happen is this will divert blood flow away from the genital area, and cause the problems with the wedding tackle to subside in a more reasonable amount of time.
NOTE: this will not work if you have some kind of medical emergency like a Viagra induced erection which lasts more than four hours. They are not kidding: get to a hospital.
The other way, the more long term way of suppressing erections is to have very poor health. The penis is a barometer of overall health, and usually loss of erection is a warning sign.
BrevityQuest 2016 (125 words)