Access collider variables?

I have two objects colliding and would like to check if object B that A is colliding with has some specific variables or function.

How could I do that? I thought of creating a function on object B that I can call on A, but… I can’t.

So I basically got two questions. How could I call a function of another object and check the variables?

As a more random question… is there a way of having Unity open a script in Unity itself? So that I don’t have a new window popping up, but rather one of the windows in Unity itself changing to the editor…

Thanks!

Take a look at Unity - Scripting API: GameObject.GetComponent