How can I get global coordinates of object

I need to get global coordinates of gameobject like on the screen.

you can use the transform.position this gives you global ones

transform.localPosition this will gives you the local coordinates

for the Images part.

If I didnt misunderstood the images

The first referred to by transform.up

The Second referred to by Vector2.up