Did is mainly used in questions and negatives in the simple past tense.
‘Did you meet Jane yesterday?’ ‘No, I didn’t.’
‘Did she commit suicide?’ ‘Yes, she did.’
Note that in short answers, we do not repeat the entire verb. Instead, we use the auxiliary verb. In negative short answers, we add not. Usually the contracted form is used.
‘Did you see him?’ ‘No, I didn’t.’ (NOT NO, I did not.)
Did is also possible in affirmative sentences. In this case, it adds emphasis.
I did meet him yesterday, but he didn’t say anything about his holidays. (More emphatic than ‘I met him yesterday, but he didn’t say anything about his holidays.’)
Did can be used in Type 2 conditional sentences. Here we use a simple past tense in the if-clause and would + infinitive in the main clause.
These sentences are used to talk about imaginary situations.
If she didn’t recognize you, what would you do?
Note that although we use past tenses here, we are not talking about the past. We are merely imagining things.
Did can be used after supposing. Here again, we are not talking about the past. We are just thinking about hypothetical situations.
Supposing you didn’t get that job?
Did is often used in questions to make it sound more polite. Here again the reference is not to the past.
Did you want butter on your bread, sir?
(Much more polite than ‘Do you want butter…?’)
Did you want something to drink? (= Would you like something to drink?)