GetComponent from script and then comparing it with another script

Hi i am currently working on a prototype in C# for a card game and need to use the game manager to get components from two separate scripts and then compare the values,
So on one script i have health and on the other i have attack, i then need the game manager script to collect both of those and see which one is greater then destroy the other card

This is what ive got so far and im not really sure how to go on from here.

 p1Hp = playerOneCard.GetComponent<S_Card>().health;
 p2At = playerTwoCard.GetComponent<S_Card>().Attack;

 if (p1Hp >= p2At)
	{
         destroy playerTwoCard
	}
else 
    {
          destroy playerOneCard
    }

So that’s sort of a pseudo code mixture and im not really sure how to go about doing that in code.

Well, let’s say you set playerOneCard and playerTwoCard using Find(), you could then do this:

private GameObject playerOneCard;
private GameObject playerTwoCard;

void Fight() {
    playerOneCard = GameObject.Find("PlayerOneCard");
    playerTwoCard = GameObject.Find("PlayerTwoCard");
	int p1Hp = playerOneCard.GetComponent<S_Card>().health;
	int p2At = playerTwoCard.GetComponent<S_Card>().Attack;
	
	if (p1Hp >= p2At) {
		Destroy(playerTwoCard);
	}
	else {
		Destroy(playerOneCard);
	}
}

Since GameObject.Find() isn’t exactly performance friendly, you should get the objects in some other way, but that depends on how you’re selecting and setting new cards. For instance, you could use gameManager.SendMessage("PlayerOneSelectedCard", cardObject); and set it in Game Manager that way.