You use them in different cases ("Fälle" in german).
"der", "die" and "das" are the default ones you use in the Nominativ case.
In the Akkusativ case you use "den, die, das" instead, so there's only a difference for "der"/"den", which makes it harder to spot.
Generally, if you just talk about a thing, that's usually Nominativ. But if there's a verb about doing something to the thing, "brauchen" in this case, it's Akkusativ.
There's also the Dativ case for when something is done to a thing/person, but it's harder to make a general rule for that.
And, for completeness, there's also Genitiv. But don't bother with that for now. It's barely used anymore so you'll be fine without it.
Edit: Mixed up adjective and verb, now it's fixed.