Collision Detection Issue with SetActive(false) not working

When I throw something at an enemy, it doesn’t detect collision. I have a Rigidbody and Capsule collider on the player (Correctly placed on the player). For Enemy I have the same, a Rigidbody and Capsule Collider on the Enemy (Correctly placed on the enemy). I have a Enemy Script on the enemy, but it seems like the collision hits the enemy, but the enemy is never destroyed. I need it to disappear after it is destroyed, but it isn’t working right:

public class Enemy : MonoBehaviour
{
public int health = 1;

public virtual void Hit()
{
    health--;
    if (health <= 0)
    {
        Destroy(gameObject);
    }
}

You can use OnCollisionEnter and you can change the tag of the enemy and write in the script:
Public void OnCollisionEnter(Collision coll){
If(coll.gameObject.tag == “tagoftheenemy”){
Health -= 1;
if(Health <= 0){
Destroy(theplayer)
}
}
}

Sorry for indentation but I’m on the smartphone now.
You give the tag to the enemy and change with “tagoftheenemy” and change the player with the gameObject player

I hope you can do this.

Thanks for your help! I will try this out too, but I did get it working finally using another method, thanks!