Cab lights in diesels are prototypical, and in steam locos they produce a great effect - especially where the cab
has a good level of detail, although real steam engines don't normally have such lights!
Low-relief SMD LEDs are great for this purpose as they can fit quite flush to the cab roof and so don't spoil the look.
Choose yellow or white, or even dab some coloured oil to a white LED to alter the tone of the light produced.
For diesels you can either face the LED directly downwards which spreads the light into the cab interior (often suitable in OO diesels),
or you can face them upwards slightly below the roof and let the light shine back down, giving a more ambient feel
to the effect. For N gauge it helps to glue a tiny piece of silver foil to the cab roof so that the upward light reflects back
down into the whole cab evenly, but be careful to avoid short circuits with this method, as the foil will be conductive!
For steam it makes more sense to face the LED downwards directly onto the engine levers and dials as these are the features
you want to highlight.
Regardless of the loco and scale, it is best to drill 2 tiny holes to insert the wires into the back of the cab and glue it
either against the wall of the cab or directly to the roof. Be careful if your loco has sliding roof panels though, as you may
need to route and glue the LED's wires around the panels!
The LED will have 2 wires - one for positive, which should be connected via a resistor (e.g. 1k) to the decoder's BLUE wire, and
the other wire is the negative, which should be connected to one of the decoder's function outputs e.g. GREEN. Normally avoid
WHITE or YELLOW function output wires on the decoder, as these are primarily intended for directional lighting (perhaps
this is precisely what you want for diesel cab lighting!).
Thread and test...