The sun provides most of the energy for the
wind (but not ocean currents) by heating up the
ground and ocean underneath it. The air in
contact with the ground heats up and rises,
creating a low pressure area, which other air
rushes in to fill (wind).
The sun has nothing to do with ocean currents.
They exist because the Earth is rotating.