Unless you are paying for you home with all cash, It is so important to speak with a lender when you know you what to buy a home but well before you actually want to move.  A lender will let you know exactly what you need to do and not do with you finances, job, and credit if you want to buy a home.  After speaking with a lender some purchasers find they need to resolve some issues before they can get a loan.  It might take a few months, a year or more to get your ducks lined up so that you qualify for loan approval.