The best thing to do if I lose in gambling is to see it as a lost money and move one with life, until when ever their is another money which can also be risk the same way in gambling and that one should be consider as trying out my luck then next time and not trying to gain back what I have lose before, by doing so I can focus my mind in the game and make the right selection which might at least favor me.
Especially for gamblers who are still beginners, they will hardly be able to apply any self-control, although initially well as I said they will exercise strong self-control, in the end it might be violated too. Experienced gamblers already know the various conditions that are there, so obviously it's not strange to them. But honestly I don't care whether you're a beginner or an experienced gambler, the point is that if this activity is only adding to your problems because it's too much then it's better to stop now, like you said, it's better before you get too deep into it.