1. Clause substitution.
Look at this sentence:
Do you sometimes have trouble hearing people on the phone? If so, then this could be the answer.
So substitutes for the whole clause you sometimes have trouble hearing people on the phone.
Not also substitutes for a clause:
Do you have health insurance? If not, you should.
Choose either so or not to complete the sentences.
2. Substitution with do/does/did.
You can use do/does/did to substitute for a verb phrase (plus any object or complement) that has been previously mentioned.
Do you want a hand? Tell me if you do.
Here, do stands for want a hand.
She asked me to phone her, but I didn’t.
Here didn’t stands for didn’t phone her.
Change the sentences by substituting do, does or did, where appropriate.
For more information about substitution see the Grammar Reference.