check if tag is used, if not, the curent game object gets it

hi, i’m starting unity and i need some help,
BTW i’m using C# don’t know if it changes something

if(GameObject.FindWithTag(“MyTag”) == null) {
//Tag does not exist in scene
}

I think that would work