You can use Sea Foam to help with removing carbon build up from your Ford
Ranger's valve heads and pistons, but depending on how bad your vehicle
failed the smog test, Sea Foam may or may not help. Smog check repair
stations have a more heavy duty product they use which is mixed with water
and administered through your Ford's intake manifold at 2500RPM. But again,
how much this will help your Ford Ranger pass the smog check will be unknown
until after you use perform the engine decarbonization.
Removing carbon from your Ford Ranger's engine will reduce cylinder
compression, resulting in lowered NO emissions. I'm going to assume your
Ford failed the smog inspection due to high NO. If this is the case
decarbonizing your trucks engine will help you pass the smog test. If your
truck failed for other emissions (HC or CO), it's best to perform a complete
diagnosis of the failure including all emissions components prior to
performing the decarbonization due to the fact the carbon removal process,
especially one which is administered through the intake manifold while your
Ford's engine is running, is very hard on your engine and can potentially
cause more damage then good. Engine decarbonizers, except for those products
which are poured in through the gas tank, are always used at the vehicle
owners own risk.