How to push\pull an object with a click of the mouse

Hi everyone,

I am a beginner. Now I want to push an object on a left click and pull on a right click, but I don’t know how to realize it with a script. Could anybody tell me how to do that? Any help is going to be greatly appreciated!

Notice: OnMouseDown is only trigger by a left mouse click

  if(Input.GetMouseButtonDown(0)) Debug.Log("Pressed left click.");
  if(Input.GetMouseButtonDown(1)) Debug.Log("Pressed right click.");
  if(Input.GetMouseButtonDown(2)) Debug.Log("Pressed middle click.");