Chance are nil that you are "infected." Most alerts are bogus. No one, not even Apple, can remotely scan your device unless you make contact first and give permission for remote access.
However, adware can do that and it is almost always a "self-inflicted wound." Most people catch a dose when using unscrupulous download hosting sites that offer "free" things that you know will cost money elsewhere. Such sites make their money by embedding annoying adware in the "free" downloads.
Apple's help file:
Block pop-up ads and windows in Safari - Apple Support
You can do a manual removal of adware but it is a royal pain. A respected contributor here developed MalwareBytes that excels in finding adware and "PUPs"—potentially unwanted programs—and offers them up for your review and eviction.
To avoid getting more adware, get MalwareBytes ONLY from the developer's site:
https://www.malwarebytes.com/mac