When it comes to owning a home, a good rule of thumb is that you can afford to spend up to 28 percent of your gross income on housing expenses. But there's more to affording a home than keeping your monthly payments under that percentage.
Before buying, you should start by checking your credit score, which will affect the interest rate on your mortgage. Good credit can mean significantly lower monthly payments, so if your score isn't great, you might want to take some time to improve it before shopping for a home.
Next, you'll want to build up your emergency fund.
"It's always important, from a broader financial planning standpoint, to have an emergency fund," certified financial planner Michelle Brownstein tells CNBC, and it's particularly important for homeowners, who no longer have a super to help them deal with roof leaks, broken appliances or other pricey repairs.
"Generally speaking, your emergency fund should be between three and six months' worth of your day-to-day living expenses," Brownstein says.
In addition to a fully funded emergency savings account, you'll also want to have cash for a down payment. Technically, you don't have to put any money down when financing a home today, and how much you decide to put down is highly personal. But the smaller the down payment, the larger the mortgage loan and the more you'll pay in interest.
Ideally, you'll be able to put 20 percent down, says Brownstein. Anything lower and you will have to pay for private mortgage insurance (PMI), which is a safety net for the bank in case you fail to make your payments and can cost between one percent and two percent of your loan amount.
Finally, you should plan ahead for surprise expenses. Almost always, a home will end up costing you more than the sticker price, thanks to hidden costs such as mortgage interest, taxes, insurance, closing costs, maintenance and any renovations you might want to make.
Ultimately, the cost of repairs and maintenance can represent 10-to-20 percent of the price of the home each year, and closing costs can run you two-to-five percent of the total cost of the home. Plus, you should budget for moving costs, which vary but can set you back a couple thousand dollars.
Once you're prepared for all of the costs that come with home ownership, read up on eight things to give up if you want to buy your first home and start saving for your goal.
Like this story? Like CNBC Make It on Facebook.
Don't miss: 8 steps to take before buying your first home