To be absolutely certain, you should:
* Consult your owner's manual: This is the best source for precise location information specific to your vehicle.
* Look for labeling: The ECM itself might have identifying labels.
* Search online: A quick image search for "2009 Ford Ranger ECM location" might show pictures from other owners.
Be careful when searching for the ECM, as the engine compartment is hot and contains many other components.