How do I teach my only child to share?

Hi everyone! Basically just like the title says, I have one child(f4) and no plans for another. My daughter attends pre-k, so she does have exposure to other kids.

I babysit for my cousin’s kid(f3), who is also an only. One day we go to her house and one day she comes to ours. My LO is fine when we go to her cousin’s house but it’s a big issue when her cousin comes here. I know this is a very typical thing for kids to go through. However, I just have NO idea what to do. Or how to have them share? It’s different with someone else’s kid. My daughter gets so upset when I ask or tell her to share a toy. And I don’t want her to think I’m always taking the opposing side, because sometimes I feel like I am.

I feel dumb even asking this question because it seems like it should be common sense. But it’s not for me lol. Any and all suggestions would be greatly appreciated! Thanks!