Gene therapy typically involves using vectors, such as viruses, to deliver the therapeutic gene into the patient's cells. Once inside, the gene can function by replacing a faulty gene, introducing a new gene, or altering a gene's function. This process can be ex vivo, where cells are modified outside the body and then reintroduced, or in vivo, where the therapy is administered directly into the patient.