Hydrocarbons are organic compounds composed entirely of hydrogen and carbon atoms. They are the primary constituents of fossil fuels like coal, petroleum, and natural gas. Hydrocarbons can be classified into several types, including alkanes, alkenes, alkynes, and aromatic hydrocarbons.