Apple tells what to do: https://support.apple.com/en-us/HT201444
It might turn out that your idea that it still works well, is wrong.
Hi everyone,
I got an "Ancient" Ipad 2, i haven't used it for a long time but i think it still work well. Yesterday, I charged it but It didn't work at all, the Apple logo kept flashing. *Crying*
I learned on web that I should restore my Ipad but when i connected to my desktop, it appeared errors 4005, 4014 . I don't know what I should do next. Please show me! Thanks in advance!

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic