Helmets are pretty simple, they should be comfortable & secure with enough ventilation to keep you from sweating too much. The hard part is finding one that fits your head well, for most people this isn't a problem, for those with big or weird shaped heads it can be difficult.
What works well for me is simply putting the helmet on and adjusting the straps to a comfy & somewhat loose fit, then shaking my head around and headbanging a bit to see if the helmet stays securely in position. If it flops all over the place the fit is no good and you'll have to try out another size or model, if it only moves a little bit you can snug up the straps a bit and try again. If that stops the movement you're good, BUT you also want to make sure the straps aren't so tight that they're cutting off your circulation.
After you find a helmet that fits securely, pay attention to any hot spots where the helmet, straps, or buckle is pressing into your head or flesh and causing discomfort. Sometimes you can fix this with padding & strap adjustments, sometimes you can't. If you can't get a comfy fit, move on to the next helmet.
Finally, ventilation. Make sure the helmet has enough vents to keep you cool, this is gonna depend on the weather you ride in, how much you sweat, and your heat tolerance. I rotate through several helmets for this reason, I have a winter helmet with minimal vents, a spring & fall helmet which is reasonably well vented, and a summer helmet which maxes out the airflow & cooling.