For me when I am doing nights
1) Make sure I wind down after work before climbing into bed, you may be exhausted when you get back but if you dont take a bit of time 30 min/an hour to wind down before you go to bed it will make getting a restful nights sleep hard.
2) make sure you have full blackout blinds AND curtains. Ear plugs are pretty essential too. This combination will block out almost all the light from a room and make sleeping far easier, nothing worse than light flooding in on a nice summers day whilst you have to sleep!
3) If you can't sleep you can't sleep, if you do wake up naturally at 12/13:00 get up, potter about do some bits and pieces but do try and have a nap before you go into work that night.
4) sometimes you need a little extra help. This is not medical advice but sometimes I occasionally take sleeping aid to boost the amount of sleep I get if I am struggling.
5) Routine. Try and maintain a routine as you would if you were working days but adapt if for a night shift. For example I have breakfast at around 15:00, lunch at around 19:30 and dinner around 01:00. setting your body in a rhythm in anyway you can will help train it for when it's time to sleep.
6) lay off the caffiene! On nights I try and limit myself to a couple of coffees per night and make sure i dont have any caffiene after 03:00.
There is no magic bullet sadly, we are naturally day time creatures but you can make the whole process a lot easier with some effort.