The hardest moment is right when your body is about to switch from using glucose to using ketone bodies for energy. After that the hunger, feeling anxious, etc stops.
The time it takes to get to that point (when feeling "bad" intensifies) and how long the transition takes can be influenced.
Primarily, by what you eat before you fast. In general, avoid eating carbohydrates, especially simple carbohydrates like sugar, fruits, past, bread, etc. I usually eat more protein and fat before fasting.
Another "trick" during fasting is to cheat your stomach a bit by filling it with liquids - I drink lots of water and tea.
The main thing to remember - it will pass, and you will feel great after your body switches. Your mind will tell you that it will just progressively get worse the deeper you get into the fast - it's not true :)