Losses shouldn't be take heartfully. We should use it as a lesson and also a weapon so it wouldn't happen again. We must learn ahead. Losses is part of trading, but it doesn't mean to make you quit.
Loses shouldn't be taking heartfully, that's true, and that's the reason you have to risk management because if you won't, you may find yourself losing more then you could afford to lose and then you will have to take it heartfully.
As said above, the best way to manage loses would be through stop loses orders, when you enter a trade, make sure you know at what point you exit the trade even if you are in a deep lose.
Always take into consideration that stop loses orders may trigger lower then expected as when the market falls it's hard to sell.