Firstly always set yourself a reasonable limit to how much you are going to gamble with/deposit and DONT break that limit, if you can't bring yourself to follow a limit then in my honest opinion you shouldn't be gambling in the first place.
Secondly in regards to losing bets and feeling shitty. if you start losing to much in quick succession and feel yourself starting to get upset/tilted/mad then quite simply just walk away and clear your head. wether it be a quick 10 min break to get a drink and watch a youtube video or a few hours to watch a film or even a whole day, as long as you dont bet in a tilted state and come back with a clear head.
gambling with bad moods is such a quick way to rip yourself a new one.