The most effective way that I've found is to push your boner to the side, if that makes sense. The problem with this is that you gotta hide the act of pushing your boner to the side.
What's a better way? Don't you dare say folding your arms...
-
One time, a guy in my science class had a raging boner that ripped a hole in his pants.