Jeremy Silman addresses this beautifully in The Amateur's Mind. I'd follow that up with How To Reassess Your Chess.
At all times you need to evaluate your imbalances, where your pawn majority is, how developed you are, positional considerations, material, Bishops vs Knights, etc. and try to maximize what your strengths are and exploit your opponents weaknesses.
I think I am pretty good at playing both the opening and the middlegame, but I have trouble transitioning from the opening to the middlegame. I have developed all my minor pieces and castled, but after that I am totally clueless. I usually just try to make some mediocre moves to just slowly weave my way into the middlegame, but I feel like if I could make good moves I could play a lot better. Could someone please help me?