I keep doing this to myself

33F Why do I keep trying to attach myself to people when I know they don’t give a shit about me??!!! I already know this yet I still try. And when they show me I still end up feeling down about it. It’s like I keep wanting something I’ll never have or don’t have. I’m more like this when it comes to men. Not sure if it’s a trauma thing or bipolar or both idk. The simple answer would be to focus on myself and find self love I know I know already. It’s never that simple for me and my brain though.