Jonathan Klein of The Drive wrote an excellent primer on the Wonderful World of Helmets. He got it right, and I highly recommend it.
The only thing I’d add is that when you’re trying on a helmet you’re thinking about buying, don’t take it off immediately. Wear it for a good 20 minutes or so. Yes, you’ll look like a dweeb (and yes, Jonathan, that is still a word in 2021). Who cares? You won’t notice the “hot spots” of pain that can develop during a long ride by trying it on for 30 seconds. Different helmets have different shapes, and so do different heads. The key is to match the shape of the helmet with your head. Some people have Arai heads. Others have Shoei heads. Both are excellent brands that I’d trust to protect my brain, but one will likely fit you better than the other.