I think that confidence and motivation are somehow linked to each other. If you are not confident you won't feel like playing a gambling because in your head you will say that you will still lose so it would be better if you can just save that money or use that money in more valuable things. The same goes to motivation.
Those who continue despite of their previous losses are either playing for fun or they are simply motivated/confident that they can recover all their past losses once they win a really huge amount in gambling. It can be though jackpots or they will hunt a massive multiplier or they can build their balance from the bottom to the top slowly but surely.
Actually if you continue to play you risk losing other money in gambling, so if the goal is to have fun then you don't force yourself to continue because it is very difficult to control yourself after experiencing high losses, so it is highly recommended to recover some losses to be reused for the next gambling , but if it is not possible then quitting gambling will be an option and you can come back tomorrow to gamble.
When I play I usually do it for a short time. What I want is to try to see if playing for a short time I can control that I lose less, because when I started I believed that the casino, through its programs, copies the ways of playing that one has, and that after that it knows how we think, and Knowing how we think, it is easy for an AI to determine the patterns of moves, and if they change too, because we usually combine emotions, and when I saw that I lost a lot, my last moves were totally random, I did not play by patterns but rather they left what was coming and that began to give me more profits.
This is just an illusion, a legitimate casino does not need to do anything like that, they just have such an advantage over the player that no matter what you do you are bound to lose on the long term, so I suggest that you just enjoy your gambling sessions in whatever way you want and you do not think about how to outsmart the casino because there is nothing for you to outsmart as they are just using the probabilities in their favor and beating you that way.