The solution is immutable distros like Fedora Silverblue. Immutable distros are almost impossible to break. The base OS cannot be changed - all your system customizations live in your home folder and containers. And you can always rollback to a previous system snapshot if desired. https://fedoramagazine.org/what-is-silverblue/
I used to have the same problem where after tinkering, my system would eventually break and I would need to reinstall Linux. I absolutely love Fedora Silverblue but there are others like VanillaOS for an Ubuntu-based variety.