Your credit score is a three-digit summary of how you have handled debt, and it is the single biggest lever on the mortgage rate you are offered. Lenders typically pull scores from all three bureaus and use the middle one; on a joint application, the lower borrower's middle score usually rules.
Mortgage pricing works in tiers: cross a threshold and your rate — and any private mortgage insurance premium — gets cheaper. Over a long loan, a modest score bump can save tens of thousands of dollars in interest, which is why it pays to check your credit months before house hunting, not the week you apply.
Quick wins: pay every bill on time, pay revolving balances down before the statement closes, and do not open new credit right before or during the loan process. Get a preapproval early to see exactly where you stand, then estimate what that rate means monthly with the mortgage calculator.