renderer.enabled issue PleaseHelp

Hello

I am trying to make the Player disappear once it gets hit by the Enemy
using:

renderer.enabled = true;

and

renderer.enabled = false;

However, when I try to run it, an error occurs: “Type ‘UnityEngine.Component’ does not contain a definition for ‘enabled’ and no extension method ‘enabled’ of type ‘UnityEngine.Component’ can be found. Are you missing an assembly reference?”

Please tell me what I am doing wrong

Thank you very much…

public GameObject player; place for player
player.SetActive (true); to turn the player on
player.SetActive (false); to turn the player off
put the script on the other object (NOT PLAYER) and put the player in the script
Good luck!!!