At least bet what you can afford.
I got a good tip one time on betting on the horses. I was told to allocate a certain reasonable affordable amount of money for the day and consider it an entertainment expense. Once that money (and any winnings along the way) is gone, your day is done. If you get to the end of the racing day and you have money left, it’s like found money.