Best practices mitigating regression due to changes

I split my codebases to reduce the risk of changing too much code or impacting components. Still the changes cursor makes lead to a lot of regression in my applications. I find my self pursuing bug fixes a lot of time or even restoring from git.

I wonder if anyone can share best practices on how to reduce regression.

Many thanks!