Agarrar vs. coger

In Spanish, both 'agarrar' and 'coger' mean 'to grab' or 'to seize (with the hand)', but they are used differently depending on the region and context.

Agarrar

In most Spanish-speaking countries, 'agarrar' means 'to grab' or 'to seize' something with the hand. It implies a firm grip and is commonly used in everyday speech.
Agarré el vaso antes de que cayera al suelo.
(I grabbed the glass before it fell to the ground.)
No agarres eso, está caliente.
(Don't grab that, it's hot.)
El niño agarró la mano de su madre para cruzar la calle.
(The child grabbed his mother's hand to cross the street.)

Coger

In Spain, 'coger' is commonly used to mean 'to grab' or 'to seize'. However, in many Latin American countries, especially Mexico, Venezuela, and Uruguay, 'coger' has a vulgar connotation and can mean 'to have sexual intercourse'. Therefore, it is avoided in those regions in polite conversation.
Cogió el teléfono y llamó a su amigo.
(He grabbed the phone and called his friend.)
Voy a coger el autobús.
(I am going to catch the bus.)

Summary

'Agarrar' and 'coger' both mean 'to grab' or 'to seize', but their usage varies by region. 'Agarrar' is widely accepted across Spanish-speaking countries with a non-vulgar implication. On the other hand, while 'coger' is common and neutral in Spain, it has vulgar connotations in several Latin American countries and should be avoided there.