The how
The biggest tool to cultivate when working on this is mindfulness. The attitude to employ with mindfulness is curiosity. Pretend you are a curious scientist, observing your present experience and sensations with an eager interest. This adds a layer of separation between you and your pain.
Mindfulness is a skill you can be practising all the time. Of course, formal meditation exercises will help very much. But remember, we are always training our brains, and we have many opportunities in the day to practise mindfulness rather than distraction. For example, practise doing an activity that you are able to do and really bring your full attention to doing that activity, rather than multitasking.
Once you start to train in mindfulness, you will be able to direct your attention more easily. If chronic pain is the main issue, it will be most useful to be able to broaden your attention.
Broadening your attention
When we are in pain, it is very natural to focus solely on that pain, tensing up around it. The antidote to this is to get in touch with the broader elements of your experience, for example your other senses and the environment around you. By doing this, pain becomes one sensation in a sea of sounds, thoughts, smells, tastes, sights, etc. In this way, the pain monster loses its power.
The steps to do this (choose any or all that seem accessible to you):
1) Take three deep breaths into your belly and allow yourself to relax on the exhale. Notice the support of the chair/bed.
2) Start to become aware of any sounds around you, and see if you can label three of them. Notice your body relax a bit more.
3) Gently look around the room and label three things that you see. Notice your body relax a bit more.
4) Become curious about your sense of smell. Can you smell anything? If so, label the smells. Gently come back to your body and notice any areas where it has relaxed.
5) Become curious about your sense of taste. Can you taste anything? If so, label the tastes. Gently come back to your body and notice any areas where it has relaxed.
6) See if you can stay with this broader sense of awareness for another thirty seconds and reflect on what impact the exercise had.
Do this as many times and as often as you need. Remember it is a skill to practice.