Buying a home is one of the most exciting things you’ll do in your life. It’s also likely the most expensive. Unless you have a swimming pool full of cash, you’ll need to take out a mortgage to help finance the purchase of a home.Applying for a mortgage can be nerve-wracking, especially if you’re doing it for the first time. The good news is that you can set yourself up for success by following these seven steps.What Do Mortgage Lenders Look For?While eligibility criteria can vary by lender and loan type, there are a few common requirements that mortgage lenders typically look for including:Good CreditThe credit score you’ll need will depend on the type of mortgage you want. You should usually have a score of at least 620 for a conventional loan. But you might qualify with a lower credit score for other kinds of mortgages, such as those backed by the Federal Housing Administration (FHA), U.S. Department of Agriculture (USDA) or Department of Veterans Affairs (VA).Also, keep in mind that the higher your credit score, the better your interest rate will be.Verifiable IncomeLenders want to see that you can afford to repay your loan, so you’ll need to provide proof of both consistent income and employment, such as with tax returns, pay stubs or 1099 forms.They’ll also consider any assets you have that you could draw on in case of financial emergencies, such as money market accounts, stock portfolios or other properties you own.Debt-to-income (DTI) RatioYour DTI ratio is the amount you owe in monthly debt payments compared to your income. To qualify for a mortgage, your DTI ratio should typically be less than 43%, but no higher than 50%.Lenders will also likely check to see that your housing expenses—including your mortgage, homeowners insurance and property taxes—won’t exceed 28% of your gross income each month.Down PaymentHow large your down payment should be will depend on the lender and the type of mortgage you want. For a conventional mortgage, you’ll generally need a down payment of at least 3% of the home’s purchase price—though keep in mind that to avoid private mortgage insurance (PMI), you’ll have to put at least 20% down. For an FHA loan, your down payment must be at least 3.5%, while USDA and VA loans don’t require a down payment.Ultimately, the more money you put down, the lower the risk will be for the lender. Also note that a larger down payment will lower your loan-to-value (LTV) ratio, which is also appealing to lenders.How to Get a MortgageIf you’re ready to get a mortgage, follow these seven steps:1. Check Your Credit ReportsBefore you get too deep into the mortgage application process, it’s a good idea to take a step back and check your credit reports first. The health of your credit will play a big part in getting a good deal on a home loan, or even getting approved at all.Start by pulling your credit reports from each of the three major credit bureaus: Experian, Equifax and TransUnion. The easiest way to do this is by visiting annualcreditreport.com, the only website that’s authorized by federal law to provide free credit reports once per year.Next, review your reports to ensure there are no errors or accounts that aren’t yours listed that may have damaged your credit. For example, review your personal information such as name, address and Social Security number for accuracy. Also check that the credit accounts and loans listed on your reports have been reported properly, including the balance and status. Double-check that there are no mysterious accounts opened, which would signal possible identity theft.If you find an error, you can dispute it with the bureau that’s reporting the incorrect information by visiting its website. Once you submit a dispute, the bureau is required to investigate and respond within 30 days.You should also look out for negative items on your report that are correct but can harm your credit score. These include delinquent payments, accounts in collections, bankruptcy, liens and too many credit inquiries. Though you can’t dispute factual entries, you can work on remedying them before applying for your mortgage.2. Improve Your Credit ScoreThat brings us to the next step. Unless your credit is in perfect shape (if so, congratulations), you’ll want to spend some time getting it cleaned up.Your credit reports don’t contain your credit scores. Fortunately, it’s fairly easy to get your credit score for free. For example, many major credit card issuers provide your FICO score for free. Other websites allow you to see your VantageScore, though you should note this scoring model is used much less often than FICO by lenders and may differ from your FICO score by quite a few points.When it comes to the credit score needed for a mortgage, most conventional lenders consider 620 to 640 to be the minimum. Some government-backed loans will allow you to borrow with a credit score as low as 500, provided you meet certain other criteria. However, the higher your score, the more affordable your loan will likely be.One of the best ways to improve your credit score is to make all your debt payments on time and in full. Payment history—the most heavily weighted factor—accounts for 35% of your credit score. The amount of debt you owe in relation to the total amount of credit extended to you contributes to another 30% of your score, so it’s best to keep your debt as low as possible.Finally, avoid making any major purchases on credit or open new lines of credit for a few months before you plan to apply for a mortgage, as this can negatively affect the average length of your credit history and the number of hard inquiries.3. Calculate How Much House You Can AffordBefore you get your sights set on your dream home, make sure you can afford it. You can estimate how much house you can afford to buy with the 28/36 rule. This refers to your DTI ratio—for example, a 50% DTI ratio means you spend half of your monthly pre-tax income on debt repayment.Ideally, your “front-end” DTI, which includes only your mortgage-related expenses, should be below 28%. Your “back-end” ratio, which includes the mortgage and all other debt obligations, should be no more than 43%—though under 36% is ideal.If your DTI is too high, you’ll need to work on reducing or eliminating some existing debt before you apply for a home loan. And remember, your monthly loan payment is just one piece of the puzzle—there’s also interest, homeowners insurance, property taxes and (potentially) homeowners association fees. You’ll also need to consider how much of a down payment you can contribute and whether you’ll be required to pay the PMI.You can use our home affordability calculator to help you run the numbers and decide how much house you can afford.4. Choose Among the Types Of MortgagesYou’ll need to evaluate your options to decide which type of mortgage loan would best suit your needs. A few things to keep in mind include:Conventional vs. government-backed. There are two main types of mortgage loans. The first is a conventional mortgage, which means it’s provided by a private bank, credit union or online lender. These loans tend to have fairly strict eligibility requirements and higher down payments.If your credit isn’t in great shape and/or you haven’t saved up much for a down payment, you may still be able to buy a home through a government-backed mortgage such as an FHA, USDA or VA loan. These loans are still borrowed through individual lenders, but the funds are insured by the federal government. This makes these loans much less risky to the banks providing them, allowing you to secure more flexible terms.Fixed vs. variable interest rate. Another big consideration is choosing between an interest rate that’s fixed for the entire term of your loan or one that can vary. Fixed-rate loans are generally a safe bet, as you know exactly how much your mortgage payment will be each month.Variable rates tend to be less expensive in the first few years of the loans. However, the rate will reset one or multiple times throughout the loan term according to the current market. That means your interest rate could increase in the future, causing your mortgage payments to become unaffordable.Shorter vs. longer term. Finally, consider how the length of your loan will impact the cost. On one hand, a shorter loan of 15 or 20 years will allow you to pay off your loan faster and save money on interest charges. However, that also means the monthly payments will be much higher, stifling some of your cash flow. In fact, you may have to borrow a smaller amount in this scenario.Another option is to extend the loan term out to 30 years or longer. That would help make the monthly payments more affordable and even allow you to borrow more. But by increasing the number of years you spend paying back the loan, you also increase the amount of interest paid over time.Take this example: A $200,000 loan at 4% interest over 15 years would cost you a total of $266,288 when all is said and done. If you lengthen the term to 30 years, the monthly payment reduces by about a third, but you also tack on an extra $77,451 in interest over the life of the loan.5. Gather the Documents Needed for Your Mortgage ApplicationYour finances are in good shape and you know how much you can borrow. Now here comes the real work.Lenders require quite a bit of documentation as part of the mortgage approval process, so it’s a good idea to gather everything up before you’re ready to apply. Here’s what you’ll need:Income verification. First, you’ll need to prove you have the income to support your mortgage payment. Lenders will likely want to see tax returns for the last two years, as well as recent W-2 forms or pay stubs. If you’re self-employed, you’ll need to verify your income with 1099s or profit and loss statements from the past couple of years instead.If you receive income from alimony or child support, you’ll also be expected to provide court orders, bank statements and legal documentation that shows you’ll continue receiving that income.Proof of assets. In addition to income, additional assets can help you secure a mortgage. Expect to provide bank statements for checking and savings accounts, retirement accounts and other brokerage accounts from the past 60 days.List of liabilities. Lenders may also ask you to provide documentation related to outstanding debts, such as credit card balances, student loans or any existing home loans.Additional paperwork. Depending on the lender, you may have to come up with some additional documentation. For example, if you currently rent, the lender might want to see canceled rent checks or a letter from your lender as proof that you pay on time.Also, keep in mind that if you plan to use gifted funds for your down payment, you will need to provide a gift letter and detailed paper trail of where that money came from. And if you sold off an asset for cash, you may need to provide documentation proving that sale (such as a copy of the title transfer if you sold a car).6. Shop Around for the Best Mortgage RatesWith all that out of the way, it’s time to secure a loan. But don’t let your excitement cause you to jump into a contract too soon. Choosing the right mortgage lender and loan offer requires some research and patience to ensure you’re getting the best deal.The mortgage interest rate you agree to will have a major impact on the total cost of your loan. Even a fraction of a percentage point can add up to a significant chunk of change over many years. Say you borrow $200,000 at 4.25% over 30 years. You’d end up paying a total of $154,197 in interest over the life of the loan. If your rate was 3.50% instead, you’d pay $123,312 in interest, for a savings of $30,885 over those same 30 years.In addition to the interest rate, pay attention to closing costs, origination fees, mortgage insurance, discount points and other expenses that can tack on thousands of dollars to your loan. These fees often are rolled into your loan balance, meaning you pay interest on them in addition to the principal.One simple way to compare the true cost of a mortgage is by examining the annual percentage rate (APR). This is the total yearly cost of your loan once all fees are factored in, expressed as a percentage of the total borrowed. However, one thing to keep in mind is that the APR assumes you will keep the loan for its entire term; if you plan to move or refinance within a few years, the APR may be a bit misleading.7. Consider Getting PreapprovedThough it’s exciting, buying a home can also be incredibly stressful. One way to take some of the pressure off yourself as you navigate the homebuying process is getting preapproved for a mortgage.When getting preapproved, a lender will take a look at personal details such as your credit score, income and assets to ballpark how much you can borrow. This gives you a competitive edge, as home sellers know there’s a strong chance you can secure financing—and right away. Plus, rather than deciding on the home you want and then biting your nails as your mortgage application is evaluated, you can begin house hunting with a more precise number in mind.Note that being preapproved doesn’t actually mean you have the money in-hand when it comes time to buy. You will still need to submit an official mortgage application and go through the full underwriting process before getting the official approval.Bottom LineSecuring a mortgage is one of many steps in the overall homebuying process, but it’s an important one. Be sure to take the time to evaluate your options carefully. After all, 30 years is a long time to spend locked into an expensive loan.Once you have the loan approval, you’re on the home stretch. All that’s left is to prepare for closing day. That means doing a final walk through of your home, securing homeowners and title insurance, getting a cashier’s check for your down payment, and warming up your contract-signing arm.