You would use a switching power supply to convert the 48V to 3.3/5 with high efficiency.
You can either use one of your own design, or use an encapsulated DC-DC converter module.
Since Ethernet cabling is relatively thin, it's not a good idea to try running 5V over it directly.
Using a high voltage at a low current lets you get a higher wattage out of the cable.
If you try running the same wattage with a high current at 5V, the cable will drop voltage like crazy.
Note that your DC-DC converter should be of the isolated type for safety reasons.