How does natural selection work with regards to genes and what is passed to the next generation?

Genes and Loci | BioNinja

a
Those with the least favorable combination of genes survive and pass their DNA to the next generation.
b
Those with the most favorable combination of genes die off not allowing their DNA to be passed on to the next generation.
c
Natural selection allows genes to mutate changing the species of an organism.
d
Those with the most favorable combination of genes survive and pass their DNA to the next generation.

d

Those with the most favorable combination of genes survive and pass their DNA to the next generation.

Natural selection works by favoring individuals with advantageous traits or gene combinations that allow them to survive and reproduce successfully. These individuals are more likely to pass on their genes to the next generation, thereby increasing the frequency of those genes in the population over time. Conversely, individuals with less favorable gene combinations are less likely to survive and reproduce, leading to a decrease in the frequency of those genes in the population. This process of natural selection leads to gradual changes in the gene pool of a population over generations.