Hi. I went through your query in detail and can understand what you must be going through. From what you have mentioned, it seems that you are having underlying emotionally unstable traits. The good news is that you are able to understand that this pattern of behaviour is problematic which makes easier for you to work on it. You need to meet a psychiatrist or a psychologist in order to get yourself evaluated. Accordingly treatment with psychotherapy will help you get better.
Next Steps
Meet a psychiatrist or a psychologist for evaluation.