It's scary for investors of all ages when the market swoons. Here's how to stay the course.