Using Pythagorean theorem, we can find that DG is 10.(I don't think I need to explain this)
Now cosD means the adjacent side over the hypotenuse.
The side adjacent to <D is 6 and the hypotenuse is 10 so
cosD=6/10=3/5
Which means the correct answer is choice D.
Hope this helped!