How do i have this avoid default layer

I realy dont know how to use layers at all but im trying to get this to not shoot at the default layer.

int allLayersExceptMine = ~(1 << gameObject.layer);
		Collider[] colliders = Physics.OverlapSphere(transform.position, 5, allLayersExceptMine);
		
		foreach (Collider other in colliders) 
		{
			
			Debug.Log("Shooting at " + other.name);
		}

You have that very same example in the docs here. Your code seems good to me. Do you get any error?