A helmet's EPS foam distributes force and crushes upon impact but doesn't return to its original shape or thickness after it takes a hit. Replace your helmet immediately if it hits the ground during any hard crash, even if the helmet's exterior looks undamaged.
Because it can sometimes be difficult to tell if the foam has been compromised after minor falls (or even dropping it on a hard surface), it's a good idea to inspect the interior and exterior of your helmet on a regular basis. If you feel any gouges or dents, it's time to replace it.
And, if you can't remember how old your helmet is, you're probably due for a new one. Over time, heat, sweat, sun and other factors can make the foam and plastic hard, brittle and less protective.
Check out this article to learn more about helmet care and replacement: