It's a good way to reduce the risk of spending too much money because the temptation from the casino will be even greater no matter what results in we get.
If we can win money from the game, we should withdraw the winning money as soon as possible and not continue the game because it can trigger us to use more money.
After we suffer a defeat, it's better to stop immediately and calm down, like you said to relieve tension after playing.
At least multiply to stop for a moment so you can still control yourself.
I'm sorry but you can't play to any game if you stop playing immediately after each defeat, because games where you never lose don't exist, that wouldn't be real games. When you play at slots for example, you need to overcome long losing streak of dozens of losses, and sometimes hundreds of them, before getting a big win. The main difficulty is to be able to predict the length of those losing streaks to be able to get over them without wiping out your bankroll by adjusting your stake accurately.