help!

so there’s this guy who I’ve liked for a while. last year we talked for a long time and I eventually went for it and he said that he wasn’t ready for that yet. It really hurt me but I eventually moved on. I ended up talking to another guy a couple months later and just as that was going well the first guy asked me to formal. It absolutely crushed me because it had taken me so long to try and get over him and I still had feelings for him. I ended up saying no to him for formal because I didn’t want to hurt the guy I was talking to. Things ended with the second guy and I can’t help thinking that I should have just said yes to the first guy. what should I do?