A couple in their 40s with two kids wanted to buy a home. The husband worked at a high-tech firm and the wife was an architect. Together they netted about NIS 30,000 a month, and a few years ago they went ahead and did it: They built a house at a cost of NIS 2.5 million.

To do it, they used up their savings and needed a NIS 1.4 million mortgage, on which they repaid NIS 7,000 a month.

First, the construction costs came in NIS 200,000 higher than budgeted. They borrowed the money from friends and other sources. Second, sometime after they moved in, the husband lost his job. He had trouble finding work and they defaulted on their repayments. Letters began to arrive from the bank, but the couple didn't believe that the bank would foreclose on the house. Interest on debt in arrears is higher, and their interest payments began to mount fast.

Meanwhile, the real estate market began to slow. Ultimately they were forced to sell the house at a low price relative to their investment. After the sale the couple was left owing hundreds of thousands of shekels to the bank and to friends.

There are many stories like this. The common denominator is a failure to plan the investment properly. The couple invested more than they could afford and didn't have contingency plans for a rainy day.

Buying a house using borrowed money - a mortgage - is a long-term process. Chances are you'll be repaying that loan for 20 years. How can you make plans for a period that long?

You can't, but you can minimize the potential for mistakes.

How much can you afford?

Buying a home is essentially making a very big investment, and probably a very risky one. But just as nobody in their right mind would invest more than they could afford in stocks, the same should apply to a house.

The process of buying a house should start with calculating your budget. Once you know exactly how much cash you're putting up, and how much you can afford to repay each month, you know the price you can afford. Price will also dictate location and size.

If you start by finding a home you love, rather than by seeking a home that meets your budget, you may be asking for trouble.

"Think of buying a house like buying a second-hand car," advises Yossi Esh of Esh-Lidor, a real estate consultancy for homebuyers. "Usually we define our budget, then look to see what car we can afford. The problem is that too many people do things backwards - first they think what home they want, then they start calculating the costs."

How much equity can you put together?

The second stage of buying a home is checking whether you can bring in enough cash to the deal. The more cash, the smaller the mortgage and therefore the smaller your monthly payments. You might want to cash out training funds and savings accounts, but don't touch your pension savings - if only because you stand to lose about a third of the sum in penalties. If possible, tap the parents.

How much equity do you need? Usually you'll have to put up at least 40% of the price, but if possible, more is better. You can borrow 60% of the value of the home or even more, but the interest rate you pay will be higher. (The greater the proportion paid by the mortgage, the greater risk the bank is taking, and it will want compensation for that. )

Note that beefing up equity by borrowing from someone other than the bank, be it an uncle or the workplace or your credit card company, is no help: Those loans also have to be repaid, notes Amit Kaminsky, chief executive of AMG Mortgages. What's more, loans of that type can turn sour too and then feelings get involved. If you don't have the equity, put a purchase on ice: Save more and rent a home for the meantime, Kaminsky advises.

The important thing is not to stretch the boundaries. The cost of moving, buying new furniture and general repairs can add tens of thousands of shekels, too.

Attorney Eli Gon of the Shraga Buda law offices, who represents mortgage banks repossessing dwellings, recommends putting aside the equivalent of six months in mortgage installments for a rainy day if you can't make the payments; for instance, if you get fired or sick.

To what extent are monthly mortgage payments binding?

Before you sign on the dotted line, think carefully about whether your life is structured to take on a monthly commitment over time. You may not fully grasp what a mortgage means.

First and foremost, understand what you're getting into. "We see a lot of people who don't see the difference in difficulty between returning NIS 3,000 a month or NIS 5,000," says a mortgage banker. "Some people say they'll take as much as the bank will let them. Or they think that if the bank approves a certain mortgage, the buyer will be able to afford the monthly payments, but that isn't necessarily true."

Repayment ability isn't just a function of monthly income, it's a lifestyle issue, the banker adds. Some people are prepared to work day and night and forgo certain luxuries to make sure they don't default, others are more casual.

How much of your salary can you allocate?

Having decided to take out a mortgage, the next stage is to decide how much of your salary you can afford to earmark for monthly repayments - or, how much you need to live on. CEO Gil Orly of Yevulim, a financial consultancy for households, says the rule of thumb is families shouldn't plan on paying more than 20% to 25% of the parents' combined income.

AMG's Kaminsky thinks up to 30% is fine but less is better. "If you're putting up 40% of the equity and are paying out 30% of your monthly pay, you might think about getting a more modest place," he suggests. "Couples netting NIS 17,000 or NIS 18,000 a month can take out a mortgage of NIS 5,000 a month and the bank will generally approve that. But taking a mortgage of NIS 5,000 a month for 20 years is too big a commitment." They'd be better off settling for a home costing them NIS 4,000 a month or NIS 4,500.

Do you have job security?

Making long-term commitments begs the question: How secure is your job? And what sort of job is it?

A civil servant's status, for example, isn't that of a private-sector worker, let alone a self-employed person. Nor is the status of a person on fixed pay the same as a salesman earning commissions, for instance. If you feel that the financial ground under your feet isn't steady, you'd better take a smaller mortgage.

The bank also looks at potential earnings power. It will distinguish between a computer-science student and a basket-weaving student.

When doing your math, think about what things you can forgo. If you're the type that likes to eat out twice a week and can't even think about getting rid of the second family car, don't rely on being able to forgo those luxuries if the crunch comes. "People have shown they can lower their standard of living for a short time but they have difficulty adjusting to a lower standard of living over time," says Orly.

The cost of raising children must also be considered. Kids can cost thousands of shekels a month, each. The more children a family has, the harder it can be to adjust costs if needed, warns a mortgage banker.

The bottom line is that opting for a smaller, more affordable home over a bigger place will save you money. And later in life, when you can afford something better, you can sell and get a bigger place.

It's true that taxes, legal fees and moving will cost you tens of thousands of shekels each time you do this, but then there's the huge savings on interest payments, points out Kaminsky. The smaller the apartment, the lower city tax and other bills are likely to be. With equity of half a million shekels, he thinks buying a home for a million is reasonable. But better wait before buying a bigger place.