Oh wow. Ok, there are a few ways to 4x4 swap.
There are 2 main options: IFS 4x4, SFA 4x4
Either way you will need the front axle, transfer case, suspension components, 4x4 transmission, and both drive shafts. Plus knowledge and tools.
For IFS 4x4 you either need to own a 2006 Ford Ranger Sport which means it would have this logo on the back in which case you have the torsion bar front suspension, if that is the case you can mount a IFS front axle in and swap to 4x4 knuckles and such:
Or you have an XL or XLT with the coil spring suspension (best identified which the last of Sport emblem or chrome bumpers or flat black bumpers) to have IFS 4x4 you would have to swap to a 4x4 frame that has the torsion bar suspension.
Or for solid front axle 4x4 you can have any Ranger and you cut off the whole front suspension and mount a solid axle from a solid axle vehicle like a Jeep or an old F-150 from the 70s.
If you didn't understand any of the above text you have zero business thinking about doing a 4x4 swap.