The study of the mechanisms by which microorganisms obtain and utilize energy from their environment.