"y" typically translates to "there" and often replaces a prepositional phrase introduced by à, chez, en, dans, etc. (most prepositions EXCEPT for "de").
I go to the beach. - I go there.
Je vais à la plage. - J'y vais.
I'm going to eat in the restaurant. - I'm going to eat there.
Je vais manger dans le restaurant. - Je vais y manger.
"y" can also replace phrases formed as "à + {noun}" when that noun ISN'T a person
Do you play soccer? - Yes, I do.
Joues-tu au foot ? - Oui, j'y joue.
but
I call Jacques. - I call him.
Je téléphone à Jacques. - Je lui téléphone.
The pronoun "en" has many uses. One is to replace prepositional phrases introduced by "de":
Are you coming from the stadium? - Yes, I am (coming from there).
Est-ce que tu viens du stade ? - Oui, j'en viens.
It also replaces nouns introduced by partitive articles (de, de la, du, des):
Do you want some water? - Yes, I do (want some).
Veux-tu de l'eau ? - Oui, j'en veux.
"en" is also used with {verb}+de expressions:
Do you play the piano? - Yes, I do (play it).
Joues-tu du piano ? - Oui, j'en joue.
And again, it's used with expressions of quantity (beaucoup, assez, trop, etc.) followed by "de":
Do you have enough money? - Yes, I have enough.
As-tu assez d'argent ? - Oui, j'en ai assez.
note: the expression of quantity (assez, in this case) is still in the sentence with "en", after the verb
"en" is also used with numerical expressions of quantity. If there is a specific number of something, that number is still in the sentence.
Do you have any brothers? - Yes, I have two. / No, I don't.
As-tu des frères ? - Oui, j'en ai deux. / Non, je n'en ai pas.
Summary: "y" replaces prepositional phrases introduced by anything other than de, and "en" does most everything else that has to do with "de".
Remember order, as well.
Are there any apples? - Yes, there are three.
Est-ce qu'il y a des pommes ? - Oui, il y en a trois.
It also comes before the verb it applies to:
She is going to make some
Elle va en faire
Source