When you need to wake up at 6:00 AM the time you should go to bed is at least by 10:00 PM.
The average person needs at least 8 hours of sleep to function properly the next day and stay healthy as well.
So if you go to bed by 10:00 PM and wake up at 6:00 AM that would allow you to sleep at least 8 hours per night.
If you go to bed at 8:00 PM and wake up at 6:00 AM then that would allow you to sleep 10 hours per night which is even better for your health.
But as long as you're able to get at least 8 hours of sleep you'll be healthy and should be able to function during the day.
For myself any less than 8 hours of sleep per night means that I am too tired the next day and not as alert.
So I must get a minimum of 8 hours of sleep or I'm not good for working the next day.
So I would be in bed by 10:00 PM so that I can wake up by 6:00 AM the next morning to be refreshed.