If you have pedals, you can play the bass part with your feet. Start with the Tonic chord of D major and finish with the Dominant chord. We will call this 4 measure fragment a question.
Then repeat the same theme but finish with a different cadence with the Tonic chord. In order to do this, you will need to end your melody on the first or the third scale degree of the D major scale. This will be your answer.
Use Tonic, Subdominant, and Dominant chords in the root position and first inversion. At the end of measure 2 (note G), you can play a D65 (C#-E-G-A) or D34 (E-G-A-C#) chord. Avoid parallel fifths and octaves among the parts and try to use contrary motion in the bass with the soprano as much as possible.
Here is the PDF file for printing. Practice very slowly and try to achieve the fluency when you can do this exercise 3 times in a row correctly.
After you are done practicing, post your time to comments.