Doch does three different jobs. Dictionaries list them side by side as if they were the same word, which is why it looks untranslatable.
They're not interchangeable, and once you can name them you can use it.
Job one: it reverses a negative
This is the one English genuinely can't do in a single word. Someone says something negative, you want to contradict it, and German has doch.
English has to rebuild the sentence: "yes I did", "yes I have". You have to repeat the verb, because after a negative a bare "yes" is ambiguous. German doesn't have that problem. Ja agrees with a positive statement, doch overturns a negative one.1
Job two: it softens
This is the doch that turns up mid-sentence and seems to mean nothing. It belongs to a group German grammar calls Modalpartikeln: small words that don't change what a sentence says, only how it's meant.2
Here it's almost always softening, or pointing at something you both already know. It's the difference between an instruction and a nudge.
Leave it out and German sounds blunt. Which is probably part of why Germans have a reputation for bluntness in English, where they don't have it to reach for.3
Job three: it just means but
The least interesting one, and the only one dictionaries handle well. Two clauses, a contrast.1
Where to start
Use job one and ignore the rest for now. It's one syllable, it's unambiguous, and there's no way to get it wrong: someone says something untrue about you in the negative, you say doch.
That single use will make you sound more German than a month of vocabulary drilling.
Job two takes longer and probably can't be learned from a rule. It arrives after you've heard it a few hundred times in sentences you otherwise understood.