A credit score is a number given to you based on your credit history, this number is decided on the basis of your ongoing or recently closed credit activity. Your credit activity can include repayments, applications for loans, existing loans, etc.
A credit score is very similar to a school percentage or a college GPA. If you perform well in your assignments in college, you get good credit points which improves your GPA, very similarly if you repay your loans on time you get points that improve your credit score.
A good GPA, lets you get good job opportunities, similarly, a good credit score gets you good opportunities to get credit from banks or NBFCs.
If you have a bad credit score, there are a number of things you can do to improve it, such as paying your bills on time, keeping your credit utilization ratio low, and building a long credit history.