In the U.S. there's a system that reports all of your financial information to 3 different credit bureaus. When you make an owed payment late ,don't pay for something, apply for too much credit or just not even use credit your credit score shrinks. By paying bills on time ,having more available unused credit and just doing that overtime makes your score go up.This is a simplified explanation and I'm no expert ,but that's the basics of it.
Good for you getting your head in a better place.Sometimes what we want the most really is the worse thing for us.