The Dmaj7 is a barre chord so it is essential we place the index finger just right. Start by putting your index finger over all the strings at the second fret. Let your finger slightly hang over the top and attempt to push them all down. Strum these first to see if they all play with no dead sound, if not you will need to slightly move your finger up or down until the flesh presses on all the strings. Once you have the barre playing ok, put your ring finger on the fourth fret of the A string.