Step 1: Understand the question:
A technical rehearsal is a run where lights, sound, sets and cues are tested with the actors. We must find its main use.
Step 2: Check option 1, Replace dialogue:
A technical rehearsal does not replace the dialogue. The script stays the same.
Step 3: Check option 2, Create mood and atmosphere:
Mood and atmosphere are created by lights and sound design, but that is the result of design work, not the main aim of a technical rehearsal.
Step 4: Check option 3, Design costume:
Costume design is done earlier in the process. It is not the main purpose of a technical rehearsal.
Step 5: Check option 4, Overcome the technical glitches befory the public show:
The main aim is to find and fix technical problems such as late light cues or sound errors before the audience sees the show. This is correct.
Step 6: Decide:
The primary help is fixing technical problems before the public show, so option 4 is correct.
Final Answer:
Option 4 is correct.
\[ \boxed{4} \]