TBH I don’t remember it being taught formally even at a good school.
I just remember my mother telling me to turn it around, so that e.g. ‘between you and I’ becomes ‘between I and you’, which sounds all wrong.
Grammatically speaking, as regards I/me, the subject of the sentence (e.g. in ‘Jane and me went shopping, or ‘Me and Jane ditto’, it should strictly speaking be ‘Jane and I, since ‘I’ is the subject of the sentence, or one of them - I.e. the person doing the doing, so to speak.
If the person is the object - i.e. being done to - e.g. ‘He hit me’ or the indirect object ‘He gave (to) me’ then it’s ‘me’ - using ‘I’ would obviously be wrong.
In other languages that decline, like German or Latin, it’s a bit easier to tell.
In German you have ich (I) mich (me, direct object) mein (my), mir (indirect object, so ‘to me’.
English has retained fewer of these, but we still have them - they, them, their,
she, her, he, him, etc.