How exactly do you edit a gene? Like, it is very, very small thing. How do you even measure it, let alone replace it?
We have a set of tools that let you determine biological structures (sometimes entirely, sometimes only partially).
We also have a set of tools to modify genes. Some viruses already do this, so we use them. Were also using CRISPR which is based on the machinery of bacteria.
So you use the modification tools to change genes and the analytical tools to prove you did it correctly.
Of course the level of complexity is way higher since your dealing with a living organism and the modification tools (and analytical tools) aren't perfect, so there is a ton of trial and error to do to correctly.