Earth has a magnetic field primarily because it has a liquid outer core composed mainly of iron (Fe) and nickel (Ni). The movement of these molten metals in the outer core generates electric currents, which, according to the dynamo theory, produces a magnetic field.
The other options you provided—"magnets line the Equator," "rubber in the core," and "plastic and cotton in the core"—are not accurate explanations of Earth's magnetic field. The field is a result of the geodynamo process in the outer core, not due to any of those materials.