The real secret is to try to find "healthy" foods you actually like.
I have a sweet tooth and its so hard for me to give up sugar, but I fucking love pistachios and although they are calorie heavy, they are really good for you and much better than eating a box of cookies while watching Netflix or gaming.
I still snack, but the trick is to have three cookies instead of 30. Be deliberate, bring the three cookies with you, not the whole box, or else you'll overeat.
Be strategic, When you go out, still have a burger, but skip the soda totally and share the fries with your SO.
Little things like this go a long way and its much more realistic than going "cold turkey" or keto or whatever the fuck some people recommend. After a few months of this it'll be much easier to then cut out the burger or sugar altogether. And when you occasionally have a cheat day you won't feel guilty and can go all out.