How to reference GameObjects and their Components?

For example: I declare a public GameObject at the start of the script so I can decide from within the editor which particular object I want to reference. (I know you can search via tags as well) How do I get components and properties from that object? (Say I want to get the X and Y data from its Transform)

As an extension: How do I reference that same data from the object the script is placed on?

I feel like the answer is right in front of me somewhere but I cant find the answer in the manual, and haven’t understood anything I’ve found in the API. (Everything I try from the API gives me an insane number of errors)

Take a look at:

http://docs.unity3d.com/Manual/ControllingGameObjectsComponents.html