1. Use ‘I’ if you are the subject taking action in the sentence.
Example: I visited my grandparents.
2. If there’s another person in a sentence, choose ‘I’ or ‘me’ by removing that person.
Example: Give it to (Sam and) me.
Example: (George and) I left the party.
3. Use ‘myself’ when you refer back to ‘I’ for emphasis.
Example: It’s correct. I wrote it myself.
Source: Writers Write