The first thing you need to do is understand what infidelity looks like in your relationship. Every relationship is different. It's important that you establish these definitions and clearly communicate them with your partner from the beginning.
Before you start making accusations and snooping, define what you would consider infidelity and think of what your response should be. If you catch them red-handed, getting sloppy from another chick, what actions are you going to take? It's important to do this BEFORE so you can have a clear mind and not make any rash decisions. This way, you don't do something you'll regret, or get gaslighted into believing that this is something that is normal in your relationship.
But what if it's a gray area? For example - my friends, let's call them John and Jane, are in a relationship where they have decided to not watch porn. It has caused problems for them in the past, and Jane expressed that it effects her self esteem and she isn't comfortable with it. Hey, that's not everyone's cup of tea. But they had a conversation about it and agreed on it. Fast forward LITERALLY a few days later, she thinks that she caught a glimpse of something suspicious while he was on his phone. It turned out, he downloaded an app to store lil nekkid pictures of other women (I can explain how we broke into the locked folder later). Real clever, John. Jane was crushed. Her body image hasn't been the same since she had their second child, and she has a history of severe depression.
Now, they did the right thing by defining that porn is illegal in the relationship. However when she brought this up, John said that those were old photos (later discovered to be a lie), and that he doesn't think that women in bikini's and fitness influencers should be considered "porn". Jane should have mentally prepared to make a decision to leave the relationship if she found something that proved her suspicions to be true. In her depressed state, she stayed in the relationship and they now have another child together.
Decide now that if you find evidence, that you will leave the relationship and not look back. Do not lose your peace over someone who has disrespected your relationship. If you feel that there is a need to hack your boyfriend, there is already something fundamentally wrong.