There are a number of apps on the App Store that claim to be able to download YouTube videos.
But if you are used to the command line, you can use youtube-dl
on an iPad by using a shell emulator app, available from the App Store, like a-shell or ish. It requires knowing how to use a Linux shell. Here’s an article that has a Shortcut to do it using a-shell.