24v to 12v truck cigarette socket wiring
When you look at the image, the wires are :

Red 24v supply fused

White 12v output (be good to fit a fuse here as well...)

Black ground / earth

Make sure you get this correct - NOT, as you put "but it has a positive a negative and an earth wire"...

So, for your truck socket you can get male plugs and red wire to the centre pin, black wire to the outside terminals, BUT do check that the socket you use has been wired correctly...