Probuilder and Collision

Hey

I’ve been working on my first unity game. He is also almost finished (code, the rest not yet) but I have built a level, what I want is that if I shoot a bullet he does not go through the wall but disappears. this is my code:

void OnCollisionEnter(Collision col)
{

    if (col.gameObject.name == "Level" )
    {
        
        Destroy(gameObject);
    }

col.collider.name
or
col.collider.CompareTag(tag)

would do the job