field of study is the process by which plants , and some bacteria , use the energy from sunlight to produce sugar .