Basically there are times when I have work night and times when I have to work day. What is the healthiest way to handle this situation without giving up my job?
The problem is getting enough sleep. An adult should sleep about eight hours a night. Working both day and night shifts will never be healthy. I'm guessing you are asking how to handle the change between night and day shifts. With no more information about your working hours it is a bit hard to give you an answer, other than try sleeping enough to get an average of eight hours sleep each day. It is not ideal to split it up, but if you have to, you just have to get the best out of it.
I also read some research about powernaps a month ago. It said 4-15 min powernap at the middle of the day will give you the energy equivalent to one hour sleep during the night.
I worked a rotating shift once which consisted of Days(6-2) Swings(2-10) and Mids(10-6). The important part is to always listen to your body, and work out if you are feeling good, since these shifts can be hard on your body. On day shift, I would work out in the afternoon, since getting up super early can be hard. On swings, I would work out shortly before work, usually around 1. Mids was the hard part, but I would try to work out shortly after I got up, usually around 2. This means I always worked out between noon and 3 every day! The body is good at rythms, so if you cant give it a good sleep rythm, at least give it a good workout rythm. Hope that helps!