You’ll usually get hit with a penalty for tapping into your retirement savings too early, but there are some exceptions.