The secret is the same for most guitar issues: Practice, practice, practice. And as much as possible SLOW and perfect practice. Everytime you do it wrong you are training your muscle memory to do it wrong. So you want the slowly and perfectly to WAY out number the fast and sloppy.
So for the D, form and hold chord. I would start with all down stroke to start. Focus on starting open D string and strum down through the chord. Repeat. Start out ridiculously, stupidly slow. If it takes you 5 seconds making sure you pick is positioned at the D string so be it. Very, very gradually speed up.
You could if you wanted use a metronome. Set it to say 60 BPM. Get the pick in place and strum on a click. Give your self three clicks to get all set up for another perfect strum, then strum with the next click. So, strum 2 3 4 strum 2 3 4 strum 2 3 4 strum 2 3 4. When that becomes easy (10 times perfect is no sweat) I would bump up the BPM a bit, say 2 to 5 BPM. If you hit a speed where you start making mistakes, slow down until you aren't. Continue until, say, you get to 120 BPM, with the same strum, click, click, click, strum, click, click, click, strum 2 3 4 cycle. When you hit 120, go back down to 60 and do strum, click, strum, clik, strum 2 strum 4. Lather rinse and repeat...
You have to decide the appropriate speed and when you want to try to add upstrokes. But the KEY to the concept is you need to go SLOW enough that the "play it rights" vastly out number the "play it wrongs". The above is one way to apply the slow and perfect concept. The concept is way more important than my specific implementation suggestion.
Muscle memory is like a recalcitrant child, if you let youself get away with doing it wrong over and over, you will do it wrong.
Shadow