Definitely buy your helmet from a reputable bike shop where you can try them on and get good advice. Fit is very important and I would stick with well known helmet brands like Giro, Met, Specialized, Lazer etc. You don’t have to spend a lot of money to get a decent helmet, but you don’t want to be rolling the dice on Amazon.
It’s worth a little research on helmets before you go to the shop. Below is a great independent site to check out helmet crash tests and price range. More expensive helmets are not always safer, but usually lighter and more ventilated. Fit is very individual and largely unrelated to price, although you usually get better adjustment systems on the top models.
https://www.helmet.beam.vt.edu/bicycle-helmet-ratings.html