Can't get damage from enemy projectiles in Unity 3D

I’ve just started using unity and need some help with registering collisions from a bullet and affecting the player’s health. Here’s the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerHurt : MonoBehaviour
{
    public int maxHealth = 100;
    public int currentHealth;
  

    // Start is called before the first frame update
    private void Start()
    {
        currentHealth = maxHealth;
    }

    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.tag == "Bullet")
        {
            void kill();
        }
    }

  
    void kill()
    {
        if (currentHealth != 0)
        {
            currentHealth -= 10;
        }

        if (currentHealth <= 0)
        {
            Destroy(gameObject);
        }
    }
}

Well, the only problem I see is that on like 21 it should be kill();, without the void infront of it. When posting problems on the forum, you should try to post the error, what you’ve tried, and what you think is wrong, so that people have an easier time helping you.

Thanks. The code is working fine, but the player isn’t taking any damage from the bullets. I guess something is wrong with the colliders.

For OnCollisionEnter to register, both objects need to have a Collider component. I believe it also won’t trigger if either of them have IsTrigger checked.