Every fingering that fits a hand
x54220
hard
x54650
hard · no 5
x54630
hard · no 5
x54670
hard · no 5
x5465x
hard · no 5
What is true of it
Dmaj9 is D, F♯, A, C♯ and E — 1, 3, 5, 7 and 9 counted from D.
On an instrument that cannot reach all 5, the 5 and 1 go first, in that order.
The easiest of the 5 fingerings below is x54220: 4 fingers, held at the 2nd fret.
None of them uses an open string, so this chord moves up the neck unchanged — the same shape 1 fret higher is the chord a semitone above.
1 string stays silent.
Where its notes are on the neck
The brass dots are D, the root. Everything else is a chord tone with its degree printed in it.
With a different note underneath
Dmaj9/F♯
200220
Dmaj9/A
504630
Dmaj9/C♯
x44230
An inversion is the same chord with a different note lowest. The name changes to a slash name because the bass is what a listener hears as the foundation.