How do you deal with you losing your concentration How do you do deal, with losing your concentration during a chess match? Then making a bad blunder? I constantly lose concentration.
I started writing this before your comment that it is online chess. My answer is geared more toward over-the-board tournament chess. I will add a little blurb specifically about online chess at the bottom, but a lot of this applies to both.

There is a lot to your question. Primarily how you deal with it comes down to experience and practice. The unfortunate part is that everyone gets that experience all too often. The initial key to not getting into that situation as often is to try to stay calm and relaxed when you play, and use your time wisely, and do not get into deep time trouble.

The first question is how bad is the error? If it is bad enough that you lose the game, you have to just put it behind you, and prepare mentally for the next game. I find that while I take the game seriously, because it is not my profession, I do not take it too seriously, and therefore, I can put it behind me easily. Do not beat yourself up over something that you can no longer control.

If it is a mistake during the game, and not so bad that you lose, that is different. It is important to mention that sometimes you will make a losing mistake that is not obvious to your opponent, but you see it. It is important to keep an absolute poker face so you do not clue your opponent in that there is something there. When you make that type of error that you have to get in the habit of buckling down and trying that much harder at the board until the end of the game. Staying as positive as possible is important.

Other ways you can cut down on such “accidents” are making sure that you sleep and eat well. I would be careful of eating a lot of carbohydrates, or you might go into a fog that I call a “carb coma”. I also think that reading short exciting games without a board, but absolutely keeping the position in your head, will help your concentration before you even sit down at the board.

For online chess, you will lose games…a lot of games, but they really do not matter much, so put it behind you, and click rematch, and move on to the next game.

In the end, practice, practice, practice.  Good luck!