WGS involves extracting the DNA from a sample, which could be from a pathogen such as a virus or bacterium, and then using high-throughput sequencing technologies to read the entire genetic code. The resulting sequences are then assembled and compared to reference genomes to identify mutations, insertions, deletions, and other genetic variations. This detailed genetic information can provide insights into the transmission pathways, virulence, and resistance patterns of infectious agents.