A very simplistic grammar rule that doesn't always work (in the same way as 'i' before 'e' except after 'c'), but is pretty darn reliable.
If you can swap it for 'us', use 'me'. If you can swap it for 'we', use 'I'.
Gary and I went to the store= We went to the store. ✅
Gary and me went to the store= Us went to the store. ❌
He gave the gift to Gary and I= He gave the gift to we. ❌
He gave the gift to Gary and me= He gave the gift to us. ✅
Now, it's easy enough to figure this out by chopping out "Gary and" to see if it works. But, here is a tricky one that I often hear/read:
"This is a picture of Gary and I going to the park."
Now, the verb might trip you up. "But I go to the park", you might say, but that's not the subject of the sentence. The picture is.
This is a picture of we going to the park. ❌
This is a picture of us going to the park. ✅ (It's a shorter way of saying, "This is a picture of us; we're going to the park.")
IMHO, using 'me' incorrectly is colloquial and endearing. Using 'I' incorrectly is just annoyingly pretentious. Like you're trying to sound sophisticated but, instead, you're just displaying your ignorance.
And, yes, I realize this is somewhat hypocritical since my grammar is far from perfect, but it's one thing that drives me nutty. (Also, "I seen that". Gah!)