Limiting your exposure is crucial. Set the amount and stick to it. For example if you go to physical casino, take $100 in cash with you and leave credit cards at home. Everything else is just a matter of entertainment.
Of course if you gamble away $100 every day that might be a different problem - addiction.