a failed experiment is the second-best outcome
A nugget of wisdom I received early in my research career that I found myself repeating to a mentee recently. Now you can have it too!:
Obviously, if you have an idea, and you try it, and it works, that's great. But if your idea clearly, convincingly fails, you get a consolation prize: you can cross the idea off your list and start on the next one, with no regrets.
What's worse than either of these outcomes is when your idea kind of works. You made things better, but it's not statistically significant. You get some results that look good, but you're not sure if you're just seeing things. Then you're stuck wondering. Was your sample size big enough? Did you fail to consider some confounder? Did you just get unlucky, in either direction? You have to decide if you want to try the same experiment but better, or give up and try something else. There's no easy answer and you could regret either choice.
(In writing the above, I am assuming that your goal is something like finding the truth or advancing science — if your goal is just to, like, publish papers, the consequences are left as an exercise to the reader, along with any implications this may have about our scientific system)