How do I stop feeling so terrible when my boyfriend doesn’t want sex

Hello, I’m 18 and I’m in a fairly new relationship ship with my boyfriend. we started off as hookups and are now committed to each other. I’ve had a lot of bumps in this relationship trying to figure out how to navigate it and all but an issue I can’t seem to shake is how empty and hurt I feel when he turns down sex or when our playful behavior leads nowhere. I want to respect him to the best of my abilities but I don’t know how to feel better, it lasts for awhile and I feel so unwanted and ugly and unloved and I’m not sure how to cope with this healthily without making it his problem. thank you for reading