Ultra DNF- Rookie Mistakes or Epic Learning Experience

So I DNF’d my very first UltraMarathon, dropping for pain in my ankles less than halfway through the event. What went wrong? What can I do better next time?