object location

How can I print out the x and y coordinates of a game object?

print( transform.position.x );

That will do an output inside the console. Did you mean on the screen ? Then, GUI.