Fermentation is part of the overall process of cellular respiration. In the animal and plant cells that you are likely studying in class, cellular respiration occurs in the mitochondria. The end goal of cellular respiration is to produce ATP which is a cellular unit of energy. This is why many teachers refer to the mitochondria as the cell's "powerhouse."
The simple equation for cellular respiration is essentially photosynthesis in reverse. Oxygen and glucose yield carbon dioxide and water. Similar to how photosynthesis requires light, cellular respiration is heavily dependent on oxygen. The process can be effectively broken down into two main steps.
The first step is glycolysis, and it will produce 2 ATP. Which next step occurs depends on whether or not oxygen is present and which organism is involved. If oxygen is available, the next step is Krebs Cycle, and many ATP molecules are produced in this method. If oxygen is not available, then either lactic acid fermentation begins or alcoholic fermentation begins. Lactic acid fermentation occurs in animal cells, and alcoholic fermentation happens in fungal species like yeast as well as a variety of bacteria species. This is why yeast cells are an absolutely critical component for beer brewers. The yeast convert the glucose into alcohol.