The Nexus 7 is a cheap, low powered tablet at least 6 years old. I had one and loved it but it did not age well.
I would recommend you buy a new tablet but if you really don't want to try restoring it to factory settings. This will clear out the years of rubbish it has accumulated and hopefully make it more responsive.
Please be aware that doing this will delete all your photos, music, videos and files so make sure you have everything backed up before you start.
This is something I do every year or two on all my devices. It is time consuming but I find it very worthwhile.
After you have reset it the machine will be exactly as it was when you bought it, so you will have to spend time setting it up again.
Here is a handy guide
https://www.androidpit.com/how-to-reset-the-nexus-7-2013