How do I get the layer of an object

Im trying to find the layer of a gameobject through a collision with Physics.OverlapSphere, how would I do that?

resultCollider.gameObject.layer will return the layer your physics.overlapsphere returns. Remember that Physics.OverlapSphere returns an array so you need to map over that array and find the correct gameobject.