Ignore Collision

Hi, i was wondering if someone can help me, im working on a 2D game and my character can shoot i want it to ignore the colliders which ive created for my enemies raycast collision. so the bullets need to go through this invisible collider to reach the enemy. can someone help ?

I tried this code but it is obsolete.

public class BulletIgnore : MonoBehaviour
{

void OnCollisionEnter(BulletIgnore collision)
{
    if (collision.gameObject.tag == "Bullet")
    {
            
    }
}

One way to do this is to completely disable collisions between bullets and those colliders via the layer collision matrix. Put the bullets and colliders on separate layers, then uncheck the box that crosses with the layers you want to disable collisions with. Objects in these two layers won’t collide with each other nor receive collision events.