As a trader, it's very important that you keep accurate records of all factors that may impact the outcome of your trades so that you can learn from your losses, improve your performance, and do better next time. From a psychological viewpoint, by documenting actions, thoughts and emotions associated with both wins and losses, you will come to see what works and what doesn't. When it comes to losses, it is crucial to note such things as whether you were in a bad mood or acting on impulse rather than being calm and relaxed. Other factors, such as market conditions, trading strategy, preparation for the trade (such as back testing), or risk management strategy should also be included in your records.
Once you have this knowledge about your trading, you can study a series of losing trades and identify the factors that led to the trades "going wrong."
You can then change what you were doing wrong in subsequent trades and notice how you improve. The key is to take an upbeat psychological approach. Rather than dwelling on your failures, it's more useful to view past mistakes as opportunities for growth and improvement. Viewing a loss as a growing experience changes your perspective immediately. You will now focus on what you can do to achieve the greater goal of becoming a successful trader, rather than preoccupied over the loss from a few of the many trades you will make during your career.