Which process is used to separate Hydrogen and Oxygen from Water?
Problem in your question: should be be O and H, because $\ce{H2O}$ (water) is made of H (Hydrogen) and O (Oxygen). $\ce{CO2}$ is carbon dioxide, for reference.

And yes, electrolysis can be performed on many compounds, not just water.

An electrolytic reaction is where an electric current is used to drive an otherwise non-spontaneous chemical reaction. Splitting water is just one of such reactions.

You can read more here.