Sleep influences brain function and can affect DNA through epigenetic changes. Both sleep quality and duration have been linked to modifications in gene expression that can impact various aspects of brain function, including cognition and mood.