Budget: set it BEFORE you start gambling and stick to it.
Have a break from time to time, it is important to let your brain stop and consider.
Avoid drugs / drink as much as possible, they will make you loose some control innevitably.
Seek help if you feel you are no longer in control. Make a phone call to a friend or go out and speak with someone.
Anything else anyone can think of? Like... read this post before gambling?
When you are losing money, comfort yourself. Don't try to act tough because it really hurts and you need to be aware of what you are feeling and take care of yourself.
By comforting i mean doing something just for you. What ever that is or how silly it is, it doesn't matter as long it brings you comfort and joy.
Have other things in life that bring you joy and excitement, so you don't automatically get every rush from gambling. But have something else to look forward to.
There are cheap or even free activities to fill your time from climbing to gaming with your pc.
If you want you can set days when you don't gamble and try to fill those with activities that are enjoyable and productive. Productive because they bring self-esteem and that's a good balance when you had a losing streak.