@Hello113 you've had a bad run of two ghostings which is unfortunate.
It happens, it's shit, modern times and all that, but dating these days is a very often a numbers game.
I suggest that if you dated more (I know it's not easy, especially if you have any standards) then you might get used to the tough and tumble and become more resilient to the bullshit.
Only have sex with guys you want to have sex with, not with the expectation that sex is transactional and you expect that guys will want to see you again, or that they owe you continued dating.
This may mean lots more dating but not necessarily more sex as you gain your confidence about what you are looking for and who you want to date, rather than dating whoever falls into your lap every few years.
I think often a man will have sex with someone they aren't 'interested' in and so sex is not the barometer on which to judge their intentions. Men may think all women are like them and casual sex means nothing, or they might not care or have even considered your feelings, so you are going to have to be the one who safeguards your wellbeing.
Whatever upset, disappointment and hurt you are feeling now would vanish if you suddenly met someone you had a genuine connection with, so think about how you might increase your chances of meeting that person.
It's not necessarily about changing who you are, but maybe being more proactive in finding opportunities to mix with people in different circles than the ones you are already in.
It's so random if you do find someone decent, but there are lots of happy couple who did, so worth thinking about how you might make yourself more available to finding that person.