How do I stop being harsh to a barely 10 year old kid?

Let me get from the beginning. Let's say this kid's name is Aster and his brother's name is Astro. They're both my cousin. So Aster and Astro came to our home day before yesterday to hang out and because their mom was going to work she wanted me to babysit Astro which I always willingly did. So it was all good, I was going on my day with Astro and my sister with Aster. By evening their mom came to pick Astro and said Aster to behave and left (Aster was to stay back for sleepover). It was okay and fine.

Getting back to the story, day before yesterday while everyone at home was having snacks on the dining table, he somehow found my old barbie doll and he was playing with it- no problem. But then I started noticing the way he was playing with it- he was bending the doll and lifting up it's bodycon clothes while laughing. I mean he's a kid and it's not like I was sane at his age and didn't make my Barbie to splits or something. But since he was 'unintentionally' treating it inappropriately I said him kindly that you don't touch a doll like that, it's not good and blah blah. He didn't listen and made the barbie do splits and he was shoving down that doll's leg infront of everyone on table while they were eating. I straight up said it's not acceptable and that he wouldn't have done that if it was a male doll. He grinned and didn't bother hearing me. Okay, kids are being kids, fine.

Yesterday morning he out of nowhere says that I look like an African, and I knew he intended to be racist, so I replied, "you say it as if it's a bad thing, I love my brown skin tone and don't mind being a black person". He then grinned and went on saying Ugly continuously. It reminded me of my childhood bullies. He really resembles one of the 'cool' kids who use terms like bruh dude bro continuously and bully people who aren't like him. I said him that it's not funny but he continued chanting.

Updates
1 y
This whole time he was constantly using my tab to play Roblox like a crazy gambler even though I said him not to because I needed it appropriately charged for my studies. And he was being an extremely picky eater and and THREW rice in dustbin when he wasn't able to finish it, and the portion was according to his wish. And he kept on judging me for little stuff like how I eat, how I was standing weirdly while trying to make Astro sleep and it made me over simulated.
Updates
1 y
And I kind of feel cruel feeling that way because he's a kid after all, just because I was more tamed at that age doesn't mean others will be. I am readily looking for when my dad will drop him back to his home but he didn't wish to go yesterday (which was the plan) so he's going today evening.

He drains my energy so much.
How do I stop being harsh to a barely 10 year old kid?
Post Opinion