I'm sorry to hear it. Most likely your Kindle has an electronic defect, or a failure of its WiFi circuitry.
But first, before concluding that it needs either repair or replacement, I suggest that you may need to make sure of some things, and try one thing:
1. be sure that the WiFi is turned On in the settings (...obviously. Sorry to mention it.)
2. test it somewhere else than where you have failed with it. In other words, if you have a problem that is in only one location, try it elsewhere, on or to another wireless router.
(3. and if it seems to work elsewhere, you might want to reset your local router box and/or modem box, by unplugging it, or both of the boxes, from just the power, for 10 minutes or longer.)
4. after that - if it still won't work (anywhere), you will need to try doing a factory reset of the Kindle. That will erase it, but you will not lose your books - they are still stored in your online Amazon account where you bought them, and you will get access to them again, when the Kindle is registered once more, to your Amazon account (the same one where you bought them! a new account will not have those books in it, but the already-existing account will - in case I need to mention it.)
After which, you would need to have it repaired, or replaced, if even a factory reset did not cure it. (If you wish to skip any of these steps and go straight to having it replaced or service-repaired, I could understand that decision.)
If you need instructions on how to do the factory reset, or other information, please let me know in Reply. Thank you.