I was on my iPhone and a message came up saying I have 39 viruses don't click out of this page and I freaked out and closed the page?

I need help please

This is not a virus, it is adware and nothing else. It happens to me all the time and its only there to take advantage of people who do not know any better. If you still feel worried you can always call your devices manufacturer and have them confirm that it is not official. Take a screenshot if you intend on doing the call.