They're cheap and reasonably easy to change. If you have a 3.9, 5.2 or 5.9 it's on the back of the block on the passenger side, and if you have the 4.7 it's on the side of the block, also on the passenger side.
Fuel pump failures are fairly common on those, too. Usually when a fuel pump takes a crap you'll gradually lose power, just like running out of gas. Sometimes you can have someone smack the tank with a hammer while you crank it over and get it running again. When a crank sensor gives up it's just like someone clicked off the key, the truck will stall all at once instead of a gradual power loss.
If you have access to a scanner or code reader with data capability, hook it up and look for an rpm signal while you're cranking it over. No signal, likely a dead crank sensor. If you don't have a scanner, even a basic check for spark can help you diagnose it. If you have spark, the crank sensor is good. If you find you have spark see if it will run off carb cleaner or something similar.