If you dig down deep enough into mental and physical issues, you will likely uncover one  (or more) of these core needs: 1) Safety and Security, 2) Power and Control, 3) Inner Self, and 4) Relationship.  You are probably doing things to meet these needs, even if your attempts are hurting you in other ways. It might even begin to make sense when you understand it.