Ignore collision won't work on bullets

I know this was ask before and I’ve read all answeres to all questions, still, I’m stuck and I just can’t find the error.

I simply need a bullet prefab of my laser gun ignoring collision with the laser gun itself.

I’ve tried EVERYTHING. added the code to the bullets, to the guns, on both together, with different tags and so on. But no luck. Unity doesn’t give my any error messages but unless I change the starting point of the bullets to about 10-30 cm in front of my gun, the bullets get destroyed immediately by colliding with my gun. What the heck I’m doing wrong?
Are the tags wrong? Do I need to tell “what” collider is what? Do I need to add true or false? Do I need to add code to the gun instead of the prefab bullet?

I’m new to scripting and I NEED help. So please HELP ME OUT!

This is my code:

public class BulletDestroyLaser : MonoBehaviour

public Light hitLight;

void OnCollisionEnter(Collision collision)
    GameObject gun = GameObject.FindGameObjectWithTag("Lasergun");
    Physics.IgnoreCollision(gun.GetComponent<Collider>(), GetComponent<Collider>());
    ContactPoint contact = collision.contacts[0];
    hitLight = Instantiate(hitLight, transform.position, Quaternion.identity);
    Quaternion rotation = Quaternion.FromToRotation(Vector3.up, contact.normal);
    Vector3 position = contact.point;


Ok, so the code should be added to the gun itself. Still I couldn’t figure out how to make it work.
So, I just worked with layers, meaning bullets layer doesn’t effect gun layers. This isn’t optimal and not really how I wanted to do this, so if anybody knows how to use ignorCollision.