This is one of the spots where Japanese is pickier than English. The language tracks the direction a thing moves and whose side the speaker is on, and it picks a different verb for each case.
The three verbs
あげる (ageru): give, outward
Something moves from the speaker, or the speaker's side, toward someone else. 友達に本をあげた (I gave my friend a book).
くれる (kureru): give, inward
Someone gives something to the speaker or the speaker's side. 友達が本をくれた (my friend gave me a book).
もらう (morau): receive
The speaker, or their side, receives. 友達に本をもらった (I received a book from my friend).
Why English speakers slip
English uses "give" for both あげる and くれる. The difference is direction relative to the speaker. If the book ends up with you, it is くれる or もらう, never あげる. Saying 友達が本をあげた to mean "my friend gave me a book" is wrong, even though the English sentence uses "give".
watashi ga tomodachi ni ageru, I give to a friend (outward)
tomodachi ga watashi ni kureru, a friend gives to me (inward)
Polite versions
Each verb has a respectful form for talking up or down the social ladder: さしあげる (humbly give to a superior), くださる (a superior gives to you), and いただく (humbly receive). These tie into the wider politeness system in our keigo guide.
Test one of these examples in the translator and see how it comes out.
Open the Translator