To better understand your front end here is a layout of components.
And here is the exerpt from the Toyota Workshop Manual that shows you how to do it going by the book.
Front Driveshaft Removal Instructions
1. REMOVE FRONT WHEEL
2. DRAIN DIFFERENTIAL OIL
3. REMOVE FRONT AXLE HUB GREASE CAP
4. REMOVE FRONT AXLE HUB NUT
a - Remove the cotter pin and adjusting cap.
b - Remove the axle hub nut.
5. REMOVE FRONT SPEED SENSOR LH
a - Remove the bolt and speed sensor.
b - Disconnect the 2 clamps.
c - Remove the bolt and disconnect the speed sensor wire harness from the steering knuckle.
6. DISCONNECT TIE ROD END SUB-ASSEMBLY
a - Remove the cotter pin and nut.
b - Using SST, disconnect the tie rod end from the steering knuckle.
7. DISCONNECT FRONT SUSPENSION LOWER ARM ASSEMBLY WITH ATTACHMENT
a - Remove the 2 bolts and disconnect the suspension arm from the steering knuckle.
8. REMOVE FRONT DRIVE SHAFT ASSEMBLY
a - Using SST, tap out the drive shaft.
SST 09520-01010 09520-24010 (09520-32040)
NOTICE: Be careful not to damage the oil seal.
How to replace your front driveshaft when offroad?
Pretty much the same method as above but you improvise a little.
Tools Required to be carried -
1. Replacement Driveshaft
2. Some sort of Jack to raise vehicle
3. Small Crowbar or Long chisel/Cold Punch of some form or Flat head Screwdriver.
4. Medium Sized Hammer
5. Small Flathead Screwdriver
6. 10mm spanner/socket for speed sensor nut
7. 17mm spanner with a 6mm Allen Key to remove Sway Bar Link from Steering Knuckle
8. 19mm single Hex socket and breaker bar for 2 x lower bolt joint to hub bolts.
9. 35mm Single Hex socket
10. 21mm socket for wheel nuts.
Process for Changing Driveshaft Offroad
1. Find some flat clear ground to park your vehicle where your not going to bother anyone and is safe.
2. Jack up the side of the vehicle that needs the driveshaft replaced.
3. Remove Wheel on that side and place below the vehicle chassis rails as a safety precaution in case the jack lets go.
4. With hammer and small flathead screwdriver gently tap off the grease cap off the hub.
5. With the same screwdriver straighten out the cotter pin and gently tap it ou with the hammer and screwdriver.
6. Remove cotter pin and adjusting cap.
7. Get someone to put their foot on the brake pedal and with the 35mm single hex nut and breaker bar, very carefully put pressure and loosen driveshaft nut.
Note: you will be using considerable force/leverage to loosen this nut, be careful not to slip as you risk knocking yourself out on the disc brake!
8. Remove 10mm bolt holding speed sensor and carefully place speed sensor on the side, even tie it up. Do not touch the face of the sensor.
9. Use 17mm spanner over the nut whilst holding the 6mm allen key within the nut to loosen it and remove swaybar link.
10. Use breaker bar and 19mm single hex socket to remove lower 2 balljoint to hub bolts.
Note: as the bolts come loose the lower control arm "may" jerk downwards with pressure from the coil over releasing.
11. Using a piece of wood, rest it onto the end of the driveshaft and give the wood a couple taps with the hammer to loosen the outer stub in the hub.
12. Get someone to leverage the hub, out and forwards whilst you pull the outer stub out of the hub from the inner side.
13. Use the hammer and chisel/screwdriver etc and place the chisel/screwdriver against the ribs on the inner driveshaft cup angled outwards. Give a couple hard taps, and driveshaft should come loose out of the diff housing.
- Be careful not to damage the driveshaft seal on the diff housing.
- Do not drop the driveshaft so as to damage the splines on rocks.
- Reverse is the same except to note that the C-Clip at the end of the driveshaft on the inner stub should be positioned with the open end facing downwards as you push it back into the diff housing. Do not attempt to fit outer stub through hub until inner stub has seated fully.
Toyota GSIC link - http://toyota.esealtd.com/toyota/hilux/repair2/html/frame_rm000000zz9000x.html
Pdf File Link to workshop manual Instructions (05+Tacoma-USA) - http://www.ncttora.com/fsm/05+/data/ileaf/06toyrm/06toypdf/06rmsrc/rm2006ta/03600.pdf