When it comes to investing, too many people fall into the trap of just buying a few stocks here and a fund or two there, eventually adding up to an extensive but seemingly random investment portfolio. Without any coherent unifying theme to your investing, though, you'll constantly struggle to figure out whether you're on track to reach your goals or falling behind.

By contrast, having a strong investing plan puts all of your investments into a broader context and lets you judge your success much more easily. But how do you create such a plan? Let me suggest a four-step plan toward putting together an investing plan you can use to achieve all your goals.

Step 1: Know your goals.
The hardest part of planning is knowing where you're headed. Especially with long-term goals like retirement, it's hard to predict where you'll be or what you'll need decades down the road.

But without at least some goals, it's almost impossible to figure out if you're moving in the right direction. Put your goals in writing with as many details as you can, understanding that you'll refine and replace them over time.

Step 2: Know your temperament.
If you want to be comfortable with your investing, you need to invest in a way that feels natural to you. There's no single perfect way to succeed at investing; different investors have used very different strategies, focusing on everything from value stocks to high-growth stocks, dividend stocks to high-yield bonds, and commodities to real-estate investment trusts. Some investors are comfortable taking concentrated positions in just a few strong-conviction stocks, while others prefer the diversification of broad-based mutual funds or ETFs.

You can succeed with any of these strategies, or a combination of several of them. But if you try to invest in a way that doesn't fit with your temperament, you may well sabotage your long-term results. If you're a conservative investor, for instance, the wild swings that high-growth leaders make will tempt you to make the mistake of selling low after buying high. If you prefer volatile investments, then the slow but (usually) steady long-term success of IBM (NYSE: IBM), 3M (NYSE: MMM), and Caterpillar (NYSE: CAT) may be too boring. Even though 3M has continued its tradition of innovation, Caterpillar has greatly expanded its business both geographically and by adding product lines, and IBM has transformed itself from a hardware pioneer to an IT services giant, they won't give you the same thrill as an up-and-coming growth stock. Be yourself and use strategies that complement your personality, and you'll improve your chances to succeed.

Step 3: Make contingency plans.
Your investing plan needs to be able to adapt to changing conditions. You need to strike the right balance, because too rigid a plan will break apart during times of stress, whereas too loose a plan won't give you enough guidance to do you any good.

For instance, in the early and mid-2000s, many dividend investors turned to Bank of America (NYSE: BAC), US Bancorp (NYSE: USB), and other strong-yielding bank stocks as ways to generate what appeared to be safe, dependable income. Traditionally, financial stocks ranked high among dividend payers and were seen as being in the same class as utilities in terms of safety and income. When the financial crisis arose, though, many bank dividends ended up on the cutting-room floor, and dividend investors were left with the double-hit of less income and big share-price losses.

If your plan wasn't flexible enough to let you consider alternatives until the worst of the crisis had hit, it was too late to do anything to protect yourself. But the writing was on the wall for banks for some time, and an investing plan that allowed you to replace one class of dividend stocks with others could have avoided the worst of the damage from the financial crisis.

Step 4: Grade yourself.
Finally, just because you've got a plan doesn't mean you're done. You also have to make sure it keeps working for you over the year.

If you see that something isn't working as well for you as it used to, take a critical but unemotional look at what's happening. Don't let temporary market blips force you to change your entire strategy, but if problems persist for a long time, don't just coast -- improve your plan.

Get with the program
When the markets are strong, a plan may seem unnecessary. But over the long haul, a plan can really help you stay on track when tough markets tempt you to go off course. All in all, the right plan can really improve your overall returns.

Once you have a plan in place, you'll want to find investments that fit with your plan. We've got some great ideas for you to take a look at, and you can find them in the Motley Fool's special report on stocks that will help you retire rich. Get your free copy today while it lasts!

Also, has Bank of America recovered enough to make it a good investment again? Find out by reading our premium investment report on Bank of America today.

Tune in next Monday for Dan's next column on retirement, investing, and personal finance. You can follow him on Twitter @DanCaplinger.