The first thing I would be wary of is buying a home and renting it back to the homeowner. Unless you know the ins and outs of what happened to get them in the situation, I wouldn't touch the idea of renting back to them.
Second, if you know the person and you are comfortable approaching them about buying the property, then do so, otherwise, you can have a realtor work for you, but you would have to pay them a commission on the sale. Also, a realtor can help you determine if you are paying the right price for the home and what steps you need to take to purchase.
Third, unless you are paying cash, contact a lender and get pre-approved.
Fourth - Make sure you know what stage of the foreclosure process the home is in. You want to get authorization from the seller to be able to call the lender and talk with them directly, that way you have the complete details of what's going on with the home.
Fifth - Contact an attorney to do a title search. You don't want to get into the process and find out the homeowner has alot of liens on the property.
If I can be of service, let me know.