The sound of the Spanish letter D is sufficiently similar to the English D to mean that if we pronounced them both the same we would be perfectly well understood. However, if you listen to Spanish people speaking you will notice there is actually a considerable difference in the way they say this letter. Their sound is softer and lighter.
So, how can we make our “D” sound more Spanish? Well start by imagining that your tongue is longer and thicker than it really is, to the extent that it starts getting in the way of your front teeth when you pronounce the D sound. Instead of spitting out the sound just using your teeth as we do in English, allow your tongue to touch the back of your front teeth, or even slightly protrude between them, creating a far softer effect.
Now listen to yourself saying a word beginning with D, for example donde (where). Next, say a word with D in the middle, for example lado (side) and try to make the D even softer, and finally make it softer still at the end of a word such as Madrid. Like a number of other letters, the D sound tends to soften more towards the middle and ends of words, and in the case of Madrid you can even hear it sounding like “Madrith” in some accents.