The only thing harder than buying a stock is deciding when to sell. Whether you consider yourself a long-term investor or not, it is always good practice to keep Warren Buffett's mantra in mind: "Rule No.1 is: Don't Lose Money. Rule No. 2 is: Don't Forget Rule No. 1."

Whether you need to cut your losses or take a profit, read on for some simple tips you can use to help you decide whether to sell.

1. Great Stock, Battered Sector

Traders often face the difficult decision to sell a stock that they feel is the best in the market.

But what if you're watching a stock decline daily – and losing money day by day?

Although many traders will resist selling a stock – particularly if it's a great company with great returns and little debt – often, the reality is that despite its charm, a stock that's performing badly may be in a sector that is being battered.

History is a great teacher when it comes to this scenario: when a bear market occurred following the dotcom boom, the technology sector was battered brutally and it didn't just take down the stocks with massive debt and no income. Profitable companies with solid business structures were severely devalued as well. In many cases, those who held on to tech companies are still waiting for those leading technologies to return their losses.

Lesson: If you own a stock in a sector that is being battered, you should consider selling because even good companies aren't safe from the roar of the "bear." Buying and selling stock today is easier than ever and relatively cheap. Even for long-term investors, sometimes it's necessary to do a short-term sale to comply with Buffett's first rule: don't lose money!

2. Emotional Attachment

If you become emotionally attached to your stocks, you'll end up paying with losses. Part of the reason good investors fall prey to this trap is that they put so much work into finding the "right" stock. They read stocks books as thick as doorstoppers, devise brilliant stock-picking systems and carefully input this criteria into a stock picker. Finally, a careful investor will narrow his or her choice down to one "gem." Sound familiar? But if you let this stock become your pride and joy, you may suffer grave losses for it. In Jim Cramer's book "Real Money: Sane Investing in an Insane World" (2005), he says that investors should love a stock when it's making money; when it isn't, cut it loose!

Lesson: emotional attachment to stocks is nothing more than human nature and wanting to be right. Do you want to be right – or rich?

3. Unrealized Profits

A profit isn't a profit until you've taken it off the table. Period. Despite this, many investors like to inflate their egos by viewing their stocks online and relishing how much money they've made. In reality, you haven't made a penny until you press the "sell" button.

When a stock is shooting for the moon, you may begin to sense it's out of control – the price-earnings ratio becomes very inflated, everyone on television is talking about it and you're beginning to wonder just how much higher it can possibly go. This many be a good time to go for the "sell one-third" or "sell half" rule. This way, you can take some profit off the table and also keep some stock on the table so that if your stock does hit the moon, you won't be left kicking yourself for selling out of your position.

Lesson: Although the tax rate is substantially steeper for taking a profit if you've held the stock for less than a year, it's often better to have part of something than to risk having less – or nothing – once the year is through.

4. When to Sell

The real secret to knowing when to sell is to read, read, read – and then read some more. We're all busy, but take a few minutes out of the day or week to know what's going on with the market, with the economy and with your stocks in particular. Reading is like insurance: the more you know, the more you are protected.

Lesson: If you have your strategy firmly in place, one simple piece of information can give you the power you need to take action, take a profit or prevent a loss.

The Bottom Line

There is no exact science to knowing when to sell, only indicators that can give us clues. Learning from the mistakes of others is a great strategy for avoiding making those same mistakes yourself. If a solid company has a downward spiraling stock price, look for clues as to why and find out what is happening within that sector. Remember to keep a clear head when evaluating stocks and don't become emotionally attached to them. Lastly, knowledge is powerful. Read the books of those who have been successful trading and investing because they offer a wealth of knowledge and experience. There are many factors that affect the financial markets, but if you're willing to put in the time and effort to read and research your investments you will be well prepared to take profits and avoid losses.

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.