in one of two ways.
1) Non homologous end joining: At the site of strand break, the DNA simply ties the broken strands together, not worrying about the missing templates. Very sloppy.
2) Homology-directed repair: Here, splicing occurs by a more accurate method, by taking into consideration, the matching templates of the missing DNA sequence