Delayed onset muscle soreness, or DOMS, is a bit of a tricky problem. Current belief is that it is caused by microtrauma and inflammation. You should read through the article about post workout carbohydrates, getting in the nutrients you need after a workout can really help with recovery, and I’ve found stretching can as well. There is also evidence that NSAIDs can be helpful, but using them long term can have its own problems. So really there is only so much you can do, the soreness is just a part of exercise. With time, however, you’re body will become more adapted to your level of activity/training and muscle soreness typically decreases.