Behaviour doesn't persist for no reason. Any habit or way of being that you repeat or maintain even though it causes problems for you is probably being reinforced, often through underlying beliefs. This holds true for both everyday habits and chronic mental health problems.
Say you're someone who is always late. Your lateness frustrates others and means that you're often stressed out and rushed. You always tell yourself to try harder to be on time and promise to do better next time, but you're still always late. Why? Examine your beliefs: what do you really think about promptness? You might realize that you believe that people who are on time must be less busy and are therefore less important. Alternatively, you might realize that you believe that being late (e.g., for a work meeting) makes you look good--like you're working so hard you couldn't tear yourself away from your desk.
Say you just moved to a new city and you're always tired because you stay up late every night emailing or chatting online with friends from your old city. Every day when you're falling asleep at your desk in the afternoon, you promise to get to bed early, but every night, you go online to catch up with your friends. What beliefs are preventing you from getting into bed at a decent hour? Maybe you believe something like "Out of sight, out of mind," and are scared your old friends will forget about you if you don't talk every night.
Finally, say you're someone who is constantly in conflict with your partner, who unfailingly answers the question "How's it going with your boyfriend/girlfriend?" with a litany of crises and dramas. You may purport to envy a friend who always replies "Pretty good, nothing to report" to the same question, but look at your beliefs: do you secretly believe that your perpetual drama makes you seem intriguing? Alternatively, do you believe that if you don't create conflict and "keep things interesting," your partner will get bored and leave you?
Chronic Mental Health Problems
Individuals who suffer from Generalized Anxiety Disorder--a disorder characterized by chronic and excessive worry--have beliefs about worry that make it hard for them to stop. They believe that worrying (e.g., about their children) demonstrates love and support, that worry helps control outcomes (e.g., if I worry about my plane crashing, it makes it less likely to happen), that worrying in advance can prevent negative emotions if the worry comes true (e.g., if I worry that my partner will leave me, it will hurt less if it happens).
People with other chronic mental health problems also have beliefs about the usefulness of their condition. I had a client whose belief about her chronic anxiety made her reluctant to change: although being anxious most of the time decreased her quality of life, she believed that if she reduced the anxiety that fueled her spotless home, compulsive list-making, and hyper-organization, she would no longer be productive or efficient. She believed that if she weren't anxious, she'd never get anything done.
People with chronic depression may also develop beliefs about the advantages of certain aspects of their condition. An individual whose depression is such that she goes through life spotting flaws and seeing the world through a negative filter may fear that if she becomes less depressed, she'll lose her ability to think critically and spot potential pitfalls, decreasing her effectiveness at work. Similarly, someone who believes that his depressive tendency toward moody contemplation or rumination is the foundation of his artistic career may fear that working on his depression will make him less creative.
People may also have beliefs about happiness that make them reluctant to embrace or strive toward happiness: they may believe that happiness is boring, that it's shallow or ignorant, or that it's selfish.
Try identifying and testing the beliefs that motivate your habits and behaviour. If it turns out that your belief isn't true (e.g., your partner is actually considering leaving you because of all the conflict and drama), you may find it easier to change your behaviour. If your belief turns out be true (e.g., your old friendships fade when you go to bed early instead of chatting online), you can still use that information to change your behaviour (e.g., chat with your friends on your lunch break instead; accept that friendships change and seek friends in your new city).
Unidentified underlying beliefs make problem habits resistant to change. Identified beliefs provide insight and a springboard for change.