walk away or work it out?

I've been in shitty relationships in my past but now i have a great guy. My past hunts me with my insecurities & they show their ugly faces in my new relationship now. I seriously don't know what to do to help myself with them. I feel like my boyfriend doesn't deserve to deal with my bad thoughts but i love him too much to walk away but sometimes it feels like the right thing to do is break up with him because i don't want to be selfish. He has deal with everything til today but i don't want to get him tired to the point that he ends up leaving. I feel like im too good of a person & that's why i get taked for granted & i feel like he will take advantage too although he has gave me no reasons to believe so. Basically that he will do to me every single thing every other guy has done to me. Anything will help honestly i just need to hear it out from someone else similar to my situation. Overthinking & that little negative voice in my head is what kills me every time....