unity 2d if there's an object with the same tag do this code example
Example 1: unity find objects with tag
//Find a single game object
GameObject.FindWithTag("TagName");
//Find multiple game objects from tag
GameObject.FindGameObjectsWithTag("TagName");
Example 2: how to find the tag of an objecdt in unity
if(FindGameObjectsWithTag(Player){
Debug.Log("FoundPlayer")
}