Sometimes when you're going through a breakup, your friends, family, and everyone around you tells you that you deserved better, anyway.
They tell you not to be upset or harp on it because the person you were with was awful or mean to you. While you should definitely appreciate the things they're telling you, because they're the ones who love you and just want to see you happy, it doesn't mean you don't have a right to be upset.
Regardless of how long you were with someone or how things went down between the two of you, there were feelings there. Sometimes, the relationships that seemed the crappiest to outsiders who weren't in it, were the most passionate and the most intense as far as what you felt for each other.
Yes, they may not have been the perfect match for you and you told your friends or family the negative things that happened, clearly, you were still invested and felt something deep, which made you keep going in the relationship as long as you did.
You should appreciate all of the positive things they have to say about you - don't forget to do that. They are here to help you and love you, even when you are hurting, and remind you of who you are. But just because they're telling you you're better off and he/she was trash, doesn't mean you don't have a right to feel sad.
That person held a significant part of your heart and life and it'll be hard to go on without them. It'll be hard to not reach out when something reminds you of them and it'll be hard to "just move on," regardless of how many people are telling you to.
It's okay to cry over someone, even if they weren't good for you. It's okay to mourn the breakup or loss, and it's okay to be upset about it. Just because everything is going to work out for the better now that you're back on your own, doesn't mean that the void is automatically filled. Cry it out. Hurt for a while. Feel whatever you need to feel to grieve and move on because you deserve to do that and it's okay to do that.
Breakups suck. It doesn't matter how long you were with the person because you still felt something for them. You have a right to break down, a right to cry and a right to feel however crappy you feel. It's okay to not be okay - always remember that. And when you're finally feeling a little bit better and you're ready to get back out there, appreciate the ones who loved you and filled you with love when you lost love. Yes, it's for the better, but that doesn't mean it doesn't still hurt. You're justified in feeling whatever way you do and honor that.