Genomic DNA and cDNA libraries can be generated to study the entire genome or expressed genes. Genomic libraries contain all DNA including exons and introns, while cDNA libraries contain only expressed exons. λ-phage is commonly used as the vector since it can package large DNA fragments and be screened efficiently. The process involves fragmenting DNA, ligating it into λ-phage arms, packaging it into phage particles which are then plated and screened to isolate clones across the genome. cDNA is generated from mRNA and also ligated into λ-phage to create a library representing the expressed genes.