OK - Hi and welcome to the forum.
To answer your question: if you're on the PS2/XBox, you press the buttons in order whilst playing the game.
If you're on the PC, you type the codes whilst playing the game unpaused.
If you mean the GameShark codes for PS2, you'll need to buy the equipment.
And if you're looking for San Andreas help, try posting in one of the San Andreas forums: you're more likely to find people to help you rather than a lone sole wandering down memory lane through the Vice City posts so old and colourfu...
Ahem. Yes. There you go.