Hydrocarbons are organic compounds composed solely of hydrogen and carbon atoms, serving as the primary constituents of fossil fuels like coal, oil, and natural gas. They are categorized into alkanes, alkenes, and alkynes based on the types of bonds between carbon atoms, and play a crucial role in energy production and chemical manufacturing.