Have you ever played one of those matches where you played really well, went up 2-0 in games, and then stopped "playing to win" and instead "played to not lose," and so changed how you went up 2-0 in games to start with, and so lost the match? Or had a lead in the final game you needed to win, and also played to not lose, and so lost?
Most likely, after winning that first game, you continued playing the same way as you were not on the verge of winning, and deep down, you realized you had a long way to go. And so you continued to play well in the second game, not just playing-wise, but tactically doing what it took to win. But after going up 2-0 or taking a lead in the final game you needed, you realized, deep down, that you were on the verge of winning - and that's when players let up by playing to not lose, and so lose.
The key is to make it a habit to NEVER change your mentality after playing well and winning a game. Whatever worked in that game is what you want. So make a conscious effort to enter the next game with that same mentality - which often means blanking out your mind and just letting yourself go, where the only thoughts in your mind are those two or three tactical things are working, and what type of serve you should next use.