Now is the best time to buy/sell a home or refinance a mortgage because of low mortgage rates. You’ve decided to purchase a home, but do you know how to find the best mortgage rate? Here’s what you should do:

Decide how much you can afford

Since buying a home is one of the largest purchases you’ll ever make, you must carefully think about how you’ll finance it. Setting a budget can prevent you from falling in love with a home that’s out of your financial grasp.

If you’re unsure how much of your income you should spend on housing, follow the good old 28/36 percent rule. The 28/36 percent rule states that individuals shouldn’t spend more than 28% of their gross income on mortgage payments and not more than 36% of their gross income on total debt, including credit cards, mortgage payments, medical bills, and the like.

Calculate your mortgage payment

The next step is to get an estimate of your mortgage payment. If you’re mathematically inclined, you can calculate mortgage payments manually using the below formula:

M = P[r(1+r)^n/((1+r)^n)-1)]

M = the total monthly mortgage payment

P = the principal loan amount

r = the monthly interest rate (lenders provide you an annual rate, which must be divided by 12 to get the monthly interest rate)

n = number of payments over the loan’s tenure (to get the total number of payments, multiply the number of years in your loan term by 12)

You can also use a mortgage calculator to find out your estimated monthly mortgage payment. A mortgage payment includes four components—principal, interest, taxes, and insurance, as well as hidden homeownership expenses like routine maintenance, homeowners association (HOA) fees, larger utility bills, private mortgage insurance, and major repairs.

The next steps are getting preapproved by a mortgage lender and applying for a mortgage. The latter helps you get an idea of how much you can afford after the lender checks your credit, income, finances, and employment, and how much you’ll need to close the loan.