Interesting question- slot machines are actually based on a degree of randomness in each individual play, but the payouts when those random events produce a winning combination are controlled to ensure that only a certain percentage of money played is paid back. Typically in the high 90% range.
The truth is that there is no trick to slot machines. They provide random results based on set mechanics and it all comes down to luck. With that being said, not all games are the same, so picking the right options is key, and you can still change the size of the bet throughout the session for better results.