Do can be used in the following ways:
as an auxiliary verb, especially for forming questions and negatives in the simple present or simple past tense (followed by an infinitive without ‘to’): Did you enjoy the party? ♦ She does not understand. In conversation and informal written English the following negative short forms of the auxiliary verb are used: doesn’t, don’t, and didn’t.
as an intransitive verb that replaces or refers to an ordinary verb that was in a previous clause or sentence: You know as much as I do (=as much as I know).
as an auxiliary verb to form a question tag in the simple present or past tense (when there is no auxiliary or modal verb in the main clause): You teach English, don’t you? (where do is used in the main clause): ♦ They don’t believe us, do they? ♦ He did well, didn’t he?
as an ordinary transitive verb: He always did his duty.
as an ordinary intransitive verb: I need something sharp. That screwdriver will do.
When do is an ordinary transitive or intransitive verb, questions and negatives are formed by using the auxiliary verb do with it: What do you do in your spare time? ♦ He didn’t do his homework.