Antimatter containment was the process whereby antimatter and matter were kept separated by the use of magnetic fields to prevent the oppositely charged particles from colliding, which would result in the mutual destruction of the matter and antimatter, along with a violent and explosive release of energy.
Antimatter containment was a key function of a starship warp core which used both antimatter and matter, released in controlled and balanced amounts, to provide energy which powers the ship's warp drive.
Galaxy-class starships in the 24th century had a system of seven independent computer safety locks to prevent antimatter containment from being breached (TNG: "Contagion"), assuming that there was no damage to the warp core components.
In 2366 the non-corporeal Koinonians drained antimatter from the antimatter pods to use it as energy to create their replica of Marla Aster. This was stopped by increasing the shield harmonics to match the antimatter containment effectively severing the Koinonian beam. (TNG: "The Bonding")
After Wesley Crusher experimented with a static warp bubble in main engineering in early 2367 and a flash of light was registered, Geordi La Forge ran a level-2 diagnostic of the antimatter containment and warp drive to make sure that none of the systems were affected by the experiment. (TNG: "Remember Me")