I was watching a video on an app and a pop up message shows up saying that my iPad has a malware or something I'm really confused what do I do and how do I know that my device has a virus or not?
If your iPad has not been jailbroken, then it is extremely unlikely that it has malware on it, as it would have required that you explicitly installed the malware yourself.
All programs under iOS run in a sandbox, and are unable to affect each other. This is not always the case once the device has been jailbroken, and is one of the key reasons not to jailbreak an iOS device unless you know what you are doing.
Webpages that say "your computer has a virus! Give us some money and we will make it go away" are just trying to get money out of you. Ignore.
This is a duplicate question.
Yes, you can get malware on an iPad if you install apps from untrusted sources (Anything outside of the App Store).
However, you cannot get a virus from simply going to a website, as the process of installing an app from a third-party requires your interaction and can't be done in the background.