Mistakes are a fact of investing life. We will make investments which turn out badly - either because we made poor decisions or simply because the future did not turn out as we expected.
Mistakes cannot be avoided. Even putting your money in the bank or buying government backed securities does not make you imune from the possibility that your investments will turn out badly. Consider what happened to investors in bank deposits and bonds when the first and second oil shocks arrived in the 1970s - the real value of both deposits and bonds suffered a noticable decline.
The way to deal with mistakes is to recognise that some investments will go wrong and accept that risk as the price for trying to achieve a more meaningful return on your investments. One of the critical issues in dealing with mistakes is to deal with the mistake quickly. Usually this means taking losses early and not letting a bad situation get worse or allowing capital to be tied up in a losing investment for long periods of time.