How could I fix this code?

the code does not work for me and the both the enemy does not die nor do they play the animation.
I’m making a mobile sniper game and I want the enemy to die when the player has clicked inside of their box collider2D and I want the enemy to play a death animation and then destroy itself.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Audio;

public class Click : MonoBehaviour
{
public GameObject gameCharacter;
private Animator anim;

// Start is called before the first frame update
void Start()
{
    anim = GetComponent<Animator>();
}

// Update is called once per frame

void OnMouseEnter(BoxCollider2D collider2D)
{
    if (Input.GetMouseButtonDown(0))
    {
        anim.Play("stickDeath");
        Destroy(gameCharacter, 0.6f);
    }
}

}

Why don’t you just use the OnMouseDown function instead of OnMouseEnter, then make the animator public and drag and drop your enemy into the animator field.
For example:

public Animator anim;
void OnMouseDown() 
{
   anim.Play("stickDeath");
}