To body search a soldier in Metal Gear Solid 4, first sneak up behind him and hold him at gunpoint by pressing and holding L1 to aim your weapon (this must be a firearm such as the Operator or M4). Keep your weapon trained on him and walk around to face him.
Next, release L1 and you should see a prompt to press Triangle. Snake will begin searching the soldier. When a large exclamation mark (!) appears at the bottom of the screen, press Triangle at that exact moment to obtain an item. You can repeat this as often as you like, though you'll only get one item per search spot.
One word of caution: be careful around the female Frog soldiers in their metal suits, as they'll react aggressively and trigger an alert phase if provoked. This technique won't work on the Beauty and Beast Corps members. A tranquilizer gun works similarly for beginners in case you misfire. Good luck! — Naruto Master 1514