Some mortals are confused by these two words, especially the Americans. However, the matter is simple.
“I” (yo) is a subject pronoun and “me” is an object pronoun.
Consider this question: who is there? Many mortals would say “it is me”. This is simply wrong and reveals an unthinking mind (una mente irreflexiva). The mistake is endemic (endémico). The correct response is “it is I”. Would you say “es me” in Spanish. No.
Now for the correct use of “me”. “The King of Spain gave me a piano” or you could say “The King of Spain gave a piano to me. “Me” in these examples is an indirect object pronoun, as in Spanish. Simple, yes?
Avoid the common mistake.