I know "en" can refer to "in". But it also sound like it can be used like:
- je me
- il se
- tu te
But in terms of "me + en" what does "en" refer to in this case? I've also seen it used like "j'en ai une".
The other answers are good, but I want to emphasize two things:
The "m" in your question is a red herring.
The "en" is a pronoun that replaces a "de" phrase. The formula is:
verb + de + noun = en + verb
Elle a besoin d'une clé ----> Elle en a besoin.
It can be hard to translate. If you translate it into English, it usually means "of the thing we were talking about" or "from the thing we were talking about" or "some."
Tu as besoin d'une clé ? Oui, j'en ai besoin !
Il a des voitures ? Oui, il en a deux ! Non, il n'en a pas.
Tu voudrais du gâteau ? Ben oui, j'en veux.
The m' in your question is the usual pronominal "me" (myself). This can combine with "en" in the usual way:
Tu te moques de tout cela ---> Tu t'en moques.
Finally, for some fossilized expressions, putting "en" before the verb changes the meaning in unpredictable ways. In all of these expressions I can think of, the verb is also pronominal, but there are probably some where it is not:
Je m'en vais = I'm going away.
Je m'en veux = I'm mad at myself for... I regret...
Je m'en fous = I don't give a damn.
"en" refers to something and it is used to not repeat a word twice in the same sentence.
In the example that you have mentioned: "j'en ai une" means I have one of something that you didn't want to repeat in the sentence.
For example, if you have the following dialogue:
SANDRA: J'ai acheté le nouveau smartphone. (I bought the new smartphone)
me : J'en ai déjà acheté un = J'ai déjà acheté le nouveau smartphone. (I have already bought it = I have already bought the new smartphone)
In this example the "it" plays the same role as "en" in the French sentence, we used "en," which refers in this case to "the new smartphone" instead of repeating the same word twice.
It is an adverbial pronoun, like 'y' is also an adverbial pronoun.
It replaces verbs which are followed by the preposition 'de'... Partitive article + Noun + De
J'en ai mangé.
au lieu de
J'ai mangé de quelque chose.
T'as envie d'une glace?
Ouais! J'en ai envie!
In the case of, m'en it may be part of s'en aller.
Je m'en vais à ma chambre.
(I go to my chambers/bedroom)
“M'en” on its own is meaningless. The way to understand this is through verbs.
In French, some verbs are followed by de. For example, se souvenir de quelque chose = “To remember something”. “Je me souviens du film.” “Je me souviens du garçon.”
For things, when you want to say, I remember it, the word en is used.
So here we get: “I remember it” [the movie] becomes: “Je m'en souviens”. Otherwise you would have to say: “Je me souviens du film”.
Then there is the case of certain idiomatic verbs: to leave or go away from from a place or here or there when not using the verb partir is s'en aller, not just aller.
“He left in June.” “Il s'en est allé en juin.” [He left HERE in June. He left THERE in June].
“Je vais m'en aller tout de suite.” [I'm leaving here (going away from this place) immediately].
Another one that follows this rule is: en vouloir à quelqu'un, which means to resent someone.
“Je lui en veux d'avoir laissé la maison si sale”. [I resent him or her for leaving the house so dirty].
This should — along with the first answer — get you started on the mysteries of en in French.