It's happened to all of us. All men have had this happen. It's no big deal...unless you make it a big deal.
Or unless others seeing it make it a big deal.
When it happened to me when I was a sophomore in high school (obviously a few decades ago), I was horribly embarrassed because I was teased about it by all the kids in the PE class. There was no way to hide it. Knowing what I know now, I could have handled it much better. I could have told them that they were just jealous because they couldn't compare with me in size, which with most of them, would have been true, then I could have made a point of showing it off. I'm not sure what would have happened then, but surely it would have been better than acting embarrassed.
There are ways to prevent unwanted erections while nude in locker rooms and showers. It requires considerable mind control, i.e., concentrating very hard on other things. Doing somewhat difficult mental arithmetic can be very effective. Try multiplying 2-digit numbers together, such as 21 x 22. For those interested, here is how to do it:
21 = (20 + 1) and 22 = (20 + 2). Therefore, 21 x 22 =
(21 + 1) x (20 + 2)
= (20 x 20) + (20 x 2) + (20 x 1) + (1 x 2)
= 400 + 40 + 20 + 2
=462
If that doesn't require enough concentration to prevent an erection, try larger numbers, such as 63 x 87, which is more difficult.