If you are in pain. Don’t ignore it. Simply be aware of the sensation with a sense of curiosity. For example, when bodybuilders work out intensely, they may experience pain. However, they don’t make the pain a apart of themselves, they understand it as a gateway to better things. You can’t change the fact that you have an injury, you can change your mindset of it.
I presume you are talking about excercise because it is relatively simple to continue with your other habits but try, if you can to modify your excercises to suit your needs but if you have been insturucted to rest, cut excercise out of your rouitine for a period of time and when you are ready, include it back in maybe with some hydrotherapy or gentlr cardio. Try to avoid doing strenuous activity or the excercise in which you injured yourself in until you are fully healed.
Go slower and make sure you don't hurt yourself more. Ask someone knowledgeable on what to do. Make sure your injury is treated, you want to slow down for a while, not stop completely.
If it's bad enough you need to seek medical treatment, hopefully including physical therapy. Either way you back off the exercise that caused and exasperated it. You have to redirect and refocus. If you're a runner with a knee injury, do exercise bike. If you're a tennis player with a shoulder problem, start jogging. Focus on moving forward even if it's on a new vector but don't give up