A contraction like don't counts as one word in writing, even though it stands for two. Picture a suitcase holding a shirt and a jacket: one bag, two items.
It means do not, with missing letters marked by an apostrophe. In you're, one written word carries you are.
In didn't, the letters of not shrink to n't and the gap is marked with an apostrophe. I didn't know keeps its meaning while the page shows fewer letters than I did not know.
In writing, a contraction counts as one word. On the page, didn't is one written word, apostrophe included, even though it carries the meaning of both originals, did and not.
What a contraction represents
When people call a contraction really two words, they mean the meaning, not the counting. Didn't holds did and not inside it, but on the page it counts as a single written word, apostrophe included. The two originals live in the sense; the written form is one unit.
Even rarer forms that combine three words, such as shouldn't've, still count as a single written unit.