I'm gonna assume you're a young lad and this was probs your first proper girlfriend, I think a lot of young people fall into a trap thinking that once they're in a relationship that they're sorted now, they don't have anything to worry about. The reality is, people can grow apart or realise they're no longer a good fit, that can happen after a month, a year, five years etc... hell people even have kids together before they realise. Always worth keeping in mind in future because it can help you know you're with someone because you're happy and not because you don't wanna be alone.
Just another thing, regardless of who ended things, it's probably worth some self-reflection once you're at a point were you can not be consumed by grief when thinking about it. Always things to learn for any potential future relationship.
Anyways I'm no expert mate just a few things I've picked up along the way, best of luck lid, better days are coming.