Some pain is the result of a known injury which just will take time to heal. Other pain is harder to figure out where it came from. This is how you can narrow it down.
If you have a pain that has come on gradually, this could mean a few things. First, it could be something you've been doing for a long time (even years), that is finally catching up to you. For example, you've been sitting at a desk for 20 years, and your upper back posture has led to a lot of stress on your spine and resulted in inflammation and degeneration that has grown to the point of causing pain that your brain is finally acknowledging.
It's like someone calling your name when you're really engrossed in something and you don't realize they're calling your name until they yell. That "threshold" of when you notice that person is yelling your name is different for everyone and can be influenced by many things. Inflammatory foods, your mood, etc. It is different if you're busy doing other things vs. just lying there.
Something else to consider when thinking about where your pain is coming from is whether or not you've changed something recently in your routine or surroundings. A new workout, office chair, ergonomic adjustment, pillow, or a pair of running shoes for example. Sometimes the body has adapted to even poor circumstances (like a bad pillow) and when you get a better pillow, it can have difficulty adapting. Or the new running shoes are forcing your foot into a different posture. This means there could be an imbalance (usually a certain stubborn muscle) that is holding things back.
A third thing to think about would be something that is causing systemic inflammation. For example your poor diet is finally catching up to you. If you use a heating pad or take a hot bath and it makes it worse then this could be what's going on.
If your pain is worse in the morning it is the result of the overnight buildup of inflammation from the above causes. Usually during the day, we are moving and flexing our limbs which "pushes" fluid around and through areas. When we've been sitting or lying down for a while and we get up and all of a sudden and force our body to move without giving these areas a chance to "drain" the inflammation, it hurts. Heel pain after sitting for a while or first thing in the morning is an example.
If something is worse as the day goes on, then it is the result of muscles that are upset for having to work so hard. The saying "it takes a village" applies to our body also. Muscles work together to create movement and when something goes wrong with a muscle, there are other muscles that can take up the slack. If this is just temporary then we usually don't notice, but if it happens long term we have a problem. There is a build-up of metabolic waste products like lactic acid that create pain.
Of course there are a dozen other scenarios that are impossible to address that are outside the scope of a blog, but I hope this helps you narrow down the cause of your pain.