Often, at the start of the flight, the crew will announce the times at which they'll be serving meals or you may find this info on a menu (if they hand one out) or in the inflight magazine (e.g. Korean Air).
Normally the meals are shortly after departure and/or shortly before landing. If you want to eat the first meal you can simply stay awake until it is served. For the final meal, the crew normally has to wake most everyone up for landing to check seatbelts, etc. so they just do it a bit earlier to do the meal service - all the lights turn on and it there is a lot of noise and people moving about in the cabin so it's hard to sleep. Many flights tend to try to match service the arrival time to help with jet lag, often the service will be as soon as possible for allow passengers who wish to sleep as long an interrupted period as possible. There is sometimes a paper menu provided at each seat with some hints about meal times like "dinner" (you can surmise what might be a reasonable time range in either the origin or destination), "pre-arrival snack", etcyou may wake up.
MissingReally long flights, especially daytime flights, may feature additional mid-flight meals or snacks on long haul flights is. These are easier than missingto miss since the services closecrew tries to departure and arrivallet those opting to sleep rest. However, the crew is normally flexible about these, the food served is typically less perishable, and you'll likely easily be able to get this snack later if you slept through the service and wake up hungry - just ask nicely.
Some airlines have come up with a solutions to the conflict of some passengers wanting to sleep and others wanting to be woken up to eat. Some ask that you simply leave your tray table down as a sign you want to be woken up for the service while others provide you with stickers to let the crew know your preference of sleep vs. food: