‘Y’ and ‘en’ are pronouns which can be used to represent a phrase, instead of writing out the entire phrase. ‘Y’ roughly translates as ‘there’, and ‘en’ roughly translates as ‘of it’, but the exact meaning will depend on the context. You use ‘y’ to replace a phrase which is introduced by ‘à, en, dans or sur’. Often, ‘y’ is used to replace a place name. For example:
'Je vais à Paris' becomes 'J’y vais'. '
I am going to Paris' becomes 'I am going there'.
'Il habite dans une grande maison' becomes 'Il y habite'.
'He lives in a big house' becomes 'He lives there'.
You use ‘en’ to replace a phrase which begins with ‘de’. '
Il a mangé du gâteau' becomes 'Il en a mangé'.
'He ate some of the cake' becomes 'He ate some of it'.
'Tu parles souvent de ton plan' becomes 'Tu en parles souvent'.
'You often talk about your plan' becomes 'You talk about it often'.
So, to know whether to use ‘y’ or ‘en’ it’s important to know whether a verb is followed by à, en, dans, sur or de!