How do you stay centered and focused when you are used to dwelling in an anxious or depressed or negative state...?"
You're asking about 'habit of thought'.
You created this habit out of beliefs.
A 'belief' is only a thought you keep thinking.
You believe it's necessary to have a plan of defence, to be prepared, to prevent being blind-sided... in order to avoid pain.
You believe pain is an inevitable result of misfortune or negative judgements of others, or payment for your shortcomings.
You also believe you must control circumstances.
You believe others' opinions determine your well-being.
Also, there is an insidiousness of this habit that is simply a lack of awareness of the ability to steer your own thoughts.
During the hours you're awake, you have to think about something!
Your brain is a focusing mechanism.
It's simply easy (lazy) to think about what you observe, rather than what you want to observe.
This constant state of distrust of well-being is only a habit borne of a lifetime of conditioning. Comparison to others, grades, income, conditional love, belief in 'worthiness'...
The good news is that this belief can be dropped forevermore.
And the simple step toward doing that is the belief that you must. And that you can. Easily.
Let's go back to the premise of the question.
You cannot STAY always in a joyous state, ever.
It is necessary to observe 'contrast' in order to form the new question. (and reason for your expansion)
In the observance of the unwanted situation you feel negative emotion.
The question then is: "How do you BECOME centered and focused (receptive of what you want instead).
Decide you want to. Decide it is the source of your connectedness to your well-being.. Decide it has nothing to do with the actions of others, the opinions of others, the existence of the unwanted circumstance.
Pay attention to how you feel.
If you feel 'not good', know that this train of thought is contrary to the solution.
Make a statement. to yourself about that subject that makes you feel better. Or drop the subject!
Once you feel better, you will see evidence of the Universe's (or God's) positive, perfect, life-giving response to your asking.
The goal will be that 90% of your daily life will be spent in love or apprecation or joy or interest or enthusiasm or fun or eagerness or contentment...with a feeling of ease and security and adventure and delight. 10% of your time will be spent in moments of attention toward the subjects you want to improve.