The correct way to put the flashing lights on the Christmas tree is to turn them on and put them on first, before the festoon and baubles, always from the top to the bottom, this way you can do it:
Light up the whole tree
Check if any bulbs are burnt out
Ensure a more natural effect, without the wires appear on top of the decorations