How to have coliders ignore certain other coliders?

Hi, I’ve been trying to make a feature in my game where a player can chop down trees etc. My problem is with the onCollsionEnter function. I want the ax head to be the only thing registered by the collider on the tree, but the only problem with the function is it has already activated from the ground’s collider. Is there any way I can ignore the ground, and possibly any other colliders, collision?

P.S. ik I could use something like if(collision.gameObject.tag == “ax”)
{
Do something;
}

but I want the collision to register for one frame only, and the tree has already collided with the ground.

Thank you any help you guys have!

In Edit > Project Settings > Physics, use the Layer Collision Matrix and choose what layers to ignore each other…