Good ways to get rid of razor burn?

I have terrible razor burn, and it's always worse on the wrong days like when I want to wear a bathing suit or go to a boys house so that has stopped me from doing so. I've tried many things to get rid of it, I've bought medical cream, baby powder, baby oil, aloe vera, and I have switch to multiple different razors and multiple different techniques to shave but it still doesn't work. Are there any other ways that I'm missing that work good for you?