Fasting linguistically means to refrain from doing something. Based upon this, the Angel Jibril (peace be upon him) said to Maryam—it is said it is from the speech of ʿĪsā,
“And if you see any human being, say: ‘Verily! I have vowed a fast unto the Most Beneficent (Allāh), so I shall not speak to any human being this day.” [Sūrah Maryman 19:26]
The meaning of the statement, ‘fast’ refers to refrain from talking. Hence, fasting linguistically means to refrain from doing something.
Its Islāmic definition is to refrain from food, drink, and sexual desires from the time of the second Fajr (i.e., true Fajr) until the setting of the Sun. At the beginning of Islām, the person was allowed to break his fast. To eat, drink, and have relations with his spouse as long as he doesn’t fall asleep. However, if he were to fall asleep then it is impermissible for him to eat, drink, and have relations with his spouse.
This happened for some time to the Muslims. One man, in particular, Abū Salamah. This person would exhaust himself in the fields, and when he returned from working at dinner time, his wife found him asleep. She said to him, “you have failed! And you are not allowed to eat and drink” So he continued to fast until the next day. He worked the next day until he fainted around Dhuhr time.