Epigenetics is the study of changes in gene activity that do not involve alterations to the genetic code but can still be passed on through cell division. These changes include epigenetic factors that modify the genome in two ways - DNA methylation and histone modification. Both of them affect gene transcription by turning genes on or off:
DNA methylation attaches methyl groups to the backbone of the DNA in specific places which may physically impede the binding of transcriptional proteins to the gene. Methylated DNA may also be bound by proteins that recruit other histone modifying proteins, thereby forming compact, inactive chromatin.
Histone modification occurs on the N-terminal tails of histones, changing how tightly or loosely they package DNA. If tightly wound, a gene may be hidden from transcriptional proteins, therefore un-accessible. If loosened, a gene that was formerly hidden may be turned on.