That's a broad stroke question. First you'll need to get your credit score to 640 or better. I say this because it'll save you thousands in closing cost in the end. Next you need to speak to an reputable and experienced lender, local or licensed to originate loans in your state, to determine whats need to be done to increase you score and what your current income will allow you to afford.
This is key: Find a good realtor who can refer you to preferably a good mortgage broker or mortgage bank that does nothing but home loans. Reason why is these two institutions have LOs that are not only licensed, but usually more experienced about loan orignation and credit repair, and are willing to take the time to work with you. Hope this helps.
As previously stated their are other factors. Your FICO's need to be a bit higher or you will have to go to a special lender and pay higher interest rate and that is only should they accept you. Why don't you go to a reputable lender and ask is there anything you can do to get your FICO's a little higher. Lenders know some easy ways to get a bump up on the FICO scores. They can also be more specific on what you can afford and what you need to do, if that does not meet your desires. That will arm you with the knowledge of exactly where you stand.