Buying a foreclosure vs a standard private party sale won't make much of a difference in this case. You still have to qualify for the loan either way. So, as the others said, your best bet is to meet with a lender to see if you would qualify for any mortgage programs. If you qualify or not will depend on how damaged your credit is, debt to income ratio, down payment, income, job history, etc.
Your best bet is to meet with a local and trusted loan officer. they can prequailify you at no cost and let you know if there are any mortgages that you can quailify for. You may want to write a letter if you can explain why the payments are late. Once you are prequalified, then you should look at homes.