The essential part of an Islamic fast is to not eat, drink or have sex, ejaculation or orgasm etc. during the day; with the conscious intention of observing a fast.
The day starts at astronomical dawn and ends at sunset.
Its sunnah to eat a little just before the start of the fast (called Suhoor ). The fast is concluded (called Iftar) with a meal or water at sunset. You can eat, drink etc. through the night.
وكلوا واشربوا حتى يتبين لكم الخيط الأبيض من الخيط الأسود من الفجر ثم أتموا الصيام إلى الليل
And eat and drink until the white thread of dawn becomes distinct to you from the black thread [of night]. Then complete the fast until the night (sunset)