Follow the plan
As an investor you should have a plan set aside before you start investing. For money I have in the stock market I generally don't plan to touch that money for about 5 years. Sure, there are some trades that I make that I expect to be shorter than five years but as a general rule of thumb most of the investments I make in companies are looking out over the next 3-5 years, MINIMUM.
Sell when you can, not when you have to
As an investor the worst feeling is having to sell a stock because you have to, not because you want to. Imagine you have a portfolio or a stock and it's down 30% but it's still a good investment or company - but now you need money. It's a pretty bad feeling to have to make that sale. Not only is it a bad feeling but it's usually a bad investing move a lot of the time. This ties into following your plan, but when things are going great and you can book some profits here and there you should. Things don't go up forever and you'll never feel awful booking a profit. You will feel bad about taking a loss at the market bottom only to look back a few years later to realize you sold near the bottom. You won't be as upset at selling "in the middle".
Understanding the risks
When getting into stocks you should know what it entails. A lot of people say they are "long-term investors" until the market punches them in the face and drops 25%. Then they become short term investors. Again, follow the plan. If you are a long-term investor and plan to buy and hold it's important to follow the "hold" part.
When it's really ugly - its really not
Usually when I get the most phone calls or texts about how ugly the market is, or I get the dreaded "get me out" after the market has dipped- that usually means we're pretty close to the bottom. I never fight a client calling me and telling me to take some money off the table after we've had a huge run but I'll usually reinforce not selling after we've had a huge selloff. Because every huge selloff has always come back... eventually. In fact, it's almost the best time to add to your investment account.
My job is to help investors do that right things when they are hard to do. That is where I actually provide the most value. Picking investments are fun and all but following the plan is boring but usually provides the best returns.
So if you haven't figured out the theme yet of what you should do during a market selloff, let me spell it out for you. Follow the plan.