If you are free to choose your shift(s), try to choose according to your chronotype, such as
working late or night shifts as an evening type ("owl").
The less you have to change your sleep rhythm the better.
If alternating shifts cannot be avoided, try to keep the same shift for as long as possible so
that your body can get used to the chang in its sleep-wake rhythm.
A clockwise rotation of shifts is best: Early shift - Late shift - Night shift. Gradually pushing
back the start of your sleep phase. This will ensure that your sleep pressure is high enough
when you go to bed and you will fall asleep and stay asleep more easily through the night in
the long run.
Shifts longer than 8 hours should ideally be followed by a day off.