wannabe1rn wrote:
Somehow Mcafee has installed a trojan on my computer. A message keeps pooping on the top right of my screen saying "trojan detected" and it click on it, it want me to buy Mcafee vires protect.
It is NOT a Trojan. The only reason for making what may appear to be such a picayune distinction is to preclude you from pursuing an unproductive way (at best) of fixing the annoyance. Don't go down that road.
Apparently, you granted one or more websites the authority to harass you with annoying Notifications. When confronted with an offer to do that, your automatic, reflexive reply ought to be "just say no." Saying NO to such scams is your first line of defense. NO stops the threat before it can even arise.
How do I make it stop.
Easy. Refer to Customize website notifications in Safari on Mac - Apple Support.
For an illustrated, step-by-step example, please refer to Community Specialist K_Faith's reply, here: fake mcafee expiration/renewal pop up - Apple Community
By way of additional explanation refer to this excerpt from Effective defenses against malware and other threats - Apple Community:
Beware spontaneously appearing, unsolicited popups demanding immediate action. Think before you click.