I second the shades
Shades or deal with it. But if you want to be real extra you could use tape for the sides and a towel up top. But honestly I would just have your child get used to it. Since some times they might not be sleeping with black out curtains at all that you don’t want the room to be 100% and then they sleep in a room with no Curtains
Amazon Basics Portable Blackout... https://www.amazon.com/dp/B08ZNTKD5D?ref=ppx_pop_mob_ap_share Add these!
Tension rod on the inside of the window frame. You will have to get shorter curtains or fold and pin them but it works well for us.
Blackout window films 👌🏼or dark shades in addition to the curtains. My daughter’s room is pitch pitch black because of these
https://a.co/d/4l452DC
I’ve seen people spray the window with water and then stick aluminum foil to the window! Never tried it but saw that online
blackout shades in addition to the curtains maybe!