Another thing that helped me was to sit on a section of trail that I was having trouble with and practice riding it. That was more for learning new skills. Endurance really comes from spending time in the saddle. Or try investing in a (dare I say it) road bike.