FORMULA
+ - / ?
V2 did + V
 
FORM
Affirmative sentences (+): V2
S   V2
I V2 I worked / wrote
We V2 We worked / wrote
You V2 You worked / wrote
They V2 They worked/ wrote
He V2 He worked / wrote
She V2 She worked / wrote
It V2 It worked / wrote
Negative sentences (-): did + NOT + V
S did not V
I did not work / write
We did not work / write
You did not work / write
They did not work / write
He did not work / write
She did not work / write
It did not work / write
did not = didn't
Interrogative sentences (?): (QW) + did + S + V … ?
(QW) did S V "what / where / when" ?
  Did I work / write   ?
  Did we work / write   ?
Where did you work / write last year ?
When did they work / write in New York ?
  Did he work / write yesterday ?
Why did she work / write   ?
  Did it work / write two days ago ?
Short answers:
Yes, S + did.
No, S + didn't.
Yes,
S did.   No, S
didn't.
Yes,
I did.   No, I didn't.
Yes,
we did.   No, we didn't.
Yes,
you did.   No, you didn't.
Yes,
they did.   No, they didn't.
Yes,
he did.   No, he didn't.
Yes,
she did.   No, she didn't.
Yes,
it did.   No, it didn't.
NOTE!
In short answers we use personal pronouns (I, we, you, they, he, she, it).
E.g.
— Did Oscar play computer games yesterday?
— Yes, he did.
(Not: Yes, Oscar did.)
***
V — Verb (the infinitive of the verb without "to"/ Present Simple verb (for I, we, you, they). E.g. write, go, listen, etc.
V2 —Verb in the 2nd form (Past Simple) E.g. wrote, went, listened, etc. Revise irregular verbs here and how to add "ed" to regular verbs here.
S — Subject of the sentence
QW — Question word