How to transform game object from script?

I have 2 game objects Jar and Key. Initially the key is inside the jar and when the user clicks on the jar , the key s position should change along the y axis, the key should pop up. This is what I did so far,

  1. created a new script called jar , assigned it to the jar game object an added an on click event and a JarClick method. I assigned the object Jar in Unity to this on click method.
    Now inside this method I need to access the game object, key’s transform and change it. Can some one please help me do this. This is my Jar script so far

public class Jar : MonoBehaviour {

public Key showKey;

public void JarClick() {

}
}

no need for a script to be on the jar.

put the public JarClick in the key script, witch is already attached to the key.

changed the OnClick event to use the key script JarClick()

Inside the JarClick() have it do the same code that the s key does.