Hydrocarbons occur in fossil fuels such as crude oil and consist mainly of hydrogen and carbon. Although they are natural chemicals, crude oil refining results in commercial products with new physico-chemical properties, which can increase their complexity and toxicity, and hamper their degradation. The presence of biodiverse natural microbial communities is a prerequisite for an effective homeostatic response to the various hydrocarbons, that contaminate ecosystems. However, their removal depends on the compartment contaminated (water, sediment, soil), their molecular weight, and their toxicity not hampering microbial activity. This paper reports different bacterial species involved in the biodegradation of aliphatic and aromatic hydrocarbons. Hydrocarbon contamination is generally due to the co-presence of a mixture of these chemicals, and their removal from the environment cannot rely on only a single species but generally requires bacterial consortia. Versatile bacterial metabolism relies on specific genes encoding the key enzymes involved in the peripheral metabolic and central metabolic pathways for degrading aliphatic and polycyclic aromatic hydrocarbons. Although microbial metabolism can have the potential for natural attenuation of these contaminants, hydrocarbon bioremediation, through biostimulation (e.g., use of surfactants, plants, earthworms, and nanoparticles) and bioaugmentation, can be a valid tool for removing them from actually contaminated soil, freshwater, groundwater, and seawater.