Breakup :( is it worth it?

I'm breaking up with my first serious boyfriend. We're in our early 20's and have been together for 3 years. I'm really sad but there was no big fight or anything we just both became disinterested and lost our connection this year. I do think it's best but I'm so so so sad. It's scaring me that a relationship inevitably ends. It's freaky that the way your partner or you feel about each other can change so drastically with time right? How do you confidently enter a new relationship after a breakup knowing that one day you will probably part ways even if it's not because of anything particularly bad? How do you regain that confidence? I just want to hear other people's stories I guess. I'm not sure how to move on from this.