The exact method varies slightly depending on the year and specific hub design, but the general process involves:
1. Park the truck on a level surface and engage the parking brake. Safety first!
2. Locate the locking hubs. They're usually on the outer ends of the front axles, near the wheels.
3. Rotate the outer ring of the hub. You'll likely feel some resistance. Turn it counter-clockwise to unlock (this often lines up with a "2WD" or "UNLOCKED" marking on the hub). You might need to use a little force.
If you're having trouble, it's possible the hubs are seized or damaged. You should consult your owner's manual for specific instructions relating to your truck's year and model. Lubrication may help if they're stiff. If you can't unlock them easily, don't force it. You risk damaging the hubs. A mechanic can assist if needed.