Yes It is best not to eat anything, especially fruit, four hours before going to bed, because sugar will accumulate in the stomach and will not be consumed easily, so it will get fat.
If you are hungry before going to bed, you can drink a glass of warm milk and eat a few salty biscuits, and eat this at most.
Typing is not easy, adopt it!