Where did early life forms get their energy?
Good question. Any answer is pure speculation.
It is unlikely that early organisms got any energy from the sun. Photosynthesis is a highly complex system of chemically engineered enzymic reactions. This complex would not have been available to early forms of life.
The breakdown of sugars and other organic molecules is as unlikely as photosynthesis. The Kreb's cycle where organic molecules are broken down to release energy is as complicated as the photosynthesis light cycle. It requires enzymes, complex structures, and energy carrying molecules like ATP, FDAH, and others.
The theory that life started in volcanic vents would suggest that the earliest forms of life got their energy from the break down of sulfur compounds. Some forms of extremophiles bacteria get there energy from the breakdown of sulfur compounds released by undersea volcanos. The chemical processes of the breakdown of toxic sulfur compounds to provide energy for living cells is not well understood.
How the information required to get energy from the breakdown of chemical occurred by accident in the early cells is not known. Which chemical were first used, where this occurred, and how are purely speculative.