As the saying goes ''bet on what you can afford to lose''. The same thing goes for investment. If you always have that at the back of your mind, you're good to go at betting.
There will be a time you'll lose and also time to win. Depending on how luck shines on you that day. But once you notice luck is against you for that day, it would be advisable to withdraw immediately to avoid more losses and try again, some other day.
Or simply stop getting all those losses back,
As OP said, he tried to gamble more instead of stopping immediately. He might thought that if he continue to play he might win that time. In this kind of situation, it is better to stop and try again the next day or a few more days before starting to gamble again.