Glycolysis is the first stage of aerobic and anaerobic respiration. Glycolysis occurs in the cytoplasm of a cell as glucose can't pass the mitochondrial membranes and the enzymes needed for its breakdown are only in the cytoplasm. Glycolysis occurs in three main steps.
Glucose is phosphorylated - two phosphate groups are added to glucose using two ATP's. This makes glucose diphosphate.
Glucose diphosphate splits into two molecules of triose phosphate
The triose phosphates are dehydrogenated (hydrogen is removed) so they are oxidised to pyruvate. This also makes two NADH molecules (one from each triose phosphate). These steps also release enough energy to synthesize four ATP molecules - that is a net of two ATP's made as two were used earlier.
If oxygen is present, then each of the NADH molecules made has the potential to make 3 ATP's in the electron transport chain. This means another six ATP's will be synthesized due to glycolysis, but only in aerobic conditions. Pyruvate will also be used in the Krebs cycle is oxygen is present.