Humanity uses about 15 TW of power. (That’s 15,000,000,000,000 watts. TW means terawatt, which is a trillion watts.) By comparison 120,000 TW of sunlight falls on the Earth. Ideally, this means one hour of sunlight could power us for one year. Practically, the top end of what we could collect would be around 600 TW, which is still a huge number. In other words, solar power could solve a lot of problems.
Solar cells like those you have probably seen work by using sunlight to make electrons move in a circuit, which is electricity. The most common design is made of layers of n- and p-type semiconductors. Light separates an electron and a hole, and the semiconductor layers make them go different directions to recombine. You cleverly make the electron go through a circuit and you get electricity.
The challenges to widespread use of solar cells are cost and intermittency. This is a good problem for scientists and engineers.