Welcome to TRS
Good resource here, bookmark this page:
https://therangerstation.com/tech_library/index.shtml
Look at the bottom in Conversions, or in Engine section for the V8 stuff
Best method for V8 swap is to find and buy a V8 explorer, 1996-2001, as a donor vehicle, you get most of the big and small bits needed
For 4WD manual trans you will want an M5OD-R2(M5R2) transmission with transfer case from 1997-2003 Ford F-150 with 4.2l V6
The 4.2l V6 in those years has the same bolt pattern as the small block windsor, 5.0l V8
So a manual transmission and transfer case from the 4.2l will bolt up to a 5.0l V8
You do need to enlarge the bellhousing holes as the 4.2l used metric bolts and the 5.0l SAE
You will need a different dash in a 2005 Ranger to do this swap, the explorer dash or a 2003 and earlier Ranger dash
2004 and up Rangers have Ford HEC dash, google it, lol, very cool but won't work for engine swaps