A gen 4 iPad is a bit long in a tooth now. It's a 11 year old device.
It would at best be running iOS 10.3.3, which is now very outdated.
The Youtube app would be outdated and probably can no longer connect to the Youtube server, and the website would likely not work correctly on such an old browser.
The websites, may be using security that the old Safari version no longer supports and it issues a security error by mistake.
The App Store is an odd one. What happens when you try to open the App Store exactly?
In general, a 4th Generation iPad at this point in time, is just too old to continue working normally.
A lot can change in 2 years.