The 2004 is a live axle, meaning the front wheels/axles are always turning the front differential. The disconnect in the drivetrain happens at the transfer case. There are no locking/unlocking hubs on that year of Ranger to speak of. Just a unit-bearing style of hub which is the wheel bearing, and is replaceable as a complete unit. They can be converted to manual hubs if one desires, but it will cost you several hundred dollars. That info is available if you search the forum or Google it for more info. If you need to replace the wheel bearing then go with the Timken brand. You'll be glad you spent the extra money, as it will likely outlast most all other brands.
The front CV axles are splined to mate up with the hub/wheel bearing assembly, which drives the wheels when in 4x4. The front wheel bearing/hub assembly also has an ABS sensor attached to it, which comes with the new unit.
If they need changed, it's a relatively straight forward job. 2 bolts to remove the caliper and 3 bolts to remove the hub. There's a large 32mm (I believe) axle nut that will have to be removed as well. Remove it first. Buy a new axle nut if you can source them and afford it.
In the picture below, what they call the driveshaft is actually the front CV axle assembly.
GB