No one is going to seriously spend time answering this question. There are, quite literally, thousands of threads on wholesaling and tons of educational materials on it, all available free, right here on Bigger Pockets.
Read the Beginner's Guide https://www.biggerpockets.com/files/329/download
At a very high level, wholesaling, its legality and how/if you can do it differ greatly from state to state. If you are asking how to complete a wholesale transaction, you're not ready to do a deal. And, if the property has already been foreclosed, it is an REO property of the lender, and there is no way you're going to be able to wholesale it.
You need to get educated, before you cost yourself and others money.
Not sure if you mean a property purchased at a foreclosure auction, but if so, depending on rules in your area, you may find it challenging to do an assignment or double-close type wholesale with a foreclosure property because you (a) may not have marketable title for some time, and/or (b) must pay full purchase amount on the day of the auction. Food for thought. If you pay for a property outright at an auction (or elsewhere, for that matter) you're typically out of the realm of wholesaling.