Remember where they said "Life, liberty and the pursuit of happiness? That is the essence of this problem. You have freedom including freedom to mess up.
On the practical side, it's a matter of structuring your money so it's not available to you for impulse buying, and make it automatic.
Have you fully funded your key necessities? You should have an 8-month emergency fund in reserve, in a different savings account. Are you fully maxing out your 401K, 403B, Roth IRA and the like? This single act is so powerful that you're crazy not to - every $1 you save will multiply to $10-100 in retirement. I know a guy who tours the country in an RV with pop-outs and tows a Jeep. He was career Air Force, so clearly not a millionaire; he saved. Money seems so trite to the young, but Seriously. THIS.
Have auto-deposits into savings or an investment account. Carry a credit card you are reluctant to use for impulse buys. Make your weekly ATM withdrawal for a fixed amount of cash, and spend only that. When your $100 has to make it through Friday, you think twice about that impulse buy.
What about online purchases? Those are a nightmare to manage. If you spend $40 online, reduce your ATM cash withdrawal by $40 the next week, is the best I can think of.
Keep in mind, many of these systems are designed to be hard to resist. That's what 1-click ordering is about; they want you to not think about the bill. That's what the "discount codes" are about; those are a fake artifice. Actually they have marked up the regular price so they are only "discounting" to the fair price. You gotta see the scam, unsubscribe and/or tune out. They are preying on you. Get angry about that!
Very good people to follow regularly are Suze Orman or Dave Ramsey, depending on your tastes.
As for the ontological... freedom is a hard problem. Once food and shelter needs are met, then what? How does a free person deny his own freedom to structure his activities for a loftier goal? Sadly, most people pitching solutions are scammers - churches, gurus, etc. - after your money or your mind. So anyone who is making an effort to get seen by you and promise to help you is probably not a good guy.
Though, Napoleon Hill managed to pry some remarkable knowledge from Andrew Carnegie in his book "Think and Grow Rich". Tony Robbins is brilliant, but he lets his staff sell expensive seminars and kit, which make him look like just another shyster. Don't buy that stuff, you don't need it and he doesn't need you to buy it.