How do you enter cheat codes on Grand Theft Auto 4?

for PC its the up arrow and up again (this brings up a blank screen) then type each cheat in using the phone number provided with the cheat.

for xbox 360 its the up keypad then up again (then same above with the cheat)
GTA IV entering cheat codes (PS3):

If you want Niko to dial a number, including cheat codes, press the directional button upwards twice, and you will get the blank screen ready for number input. Use the directional button to go to the numbers you require, pressing "X" to select each number, then select the telephone icon on the left hand side to ring that number.

To enter cheat codes:

Enter cheats during normal gameplay. Find the cheat you want to enter, activate Niko's cell phone as above and put in the numbers using the directional buttons. When the cheat is entered a message will be seen saying "Cheat Activated".
Press up on your direction pad to bring up your phone. Then press up again to bring up the dial screen. It is here that you can type in your cheat codes.
If you want Niko to dial a number, including cheat codes, press the directional button upwards twice, and you will get the blank screen ready for number input. Use the directional button to go to the numbers you require, pressing "X" to select each number, then select the telephone icon on the left hand side to ring that number.

To enter cheat codes:

Enter cheats during normal gameplay. Find the cheat you want to enter, activate Niko's cell phone as above and put in the numbers using the directional buttons. When the cheat is entered a message will be seen saying "Cheat Activated".
PS3 Cheat by: Cheat Masters

GTA IV Cheats - PS3

Dial all cheats into Niko's cell phone:

Health

482-555-0100

Armor

362-555-0100

Weapons #1

(Baseball Bat, Handgun, Shotgun, MP5, M4, Sniper Rifle, RPG, Grenades.)

486-555-0100

Weapons #2

(Knife, Molotovs, Handgun, Shotgun, Uzi, AK47, Sniper Rifle, RPG)

486-555-0150

Remove Wanted Level

(Blocks achievement "Walked free")

267-555-0100

Raise Wanted Level

267-555-0150

Change Weather/Brightness

468-555-0100

Spawn Annihilator

359-555-0100

Spawn Jetmax

938-555-0100

Spawn NRG-900

625-555-0100

Spawn Sanchez

625-555-0150

Spawn FIB Buffalo

227-555-0100

Spawn Comet

227-555-0175

Spawn Turismo

227-555-0147

Spawn Cognoscenti

227-555-0142

Spawn SuperGT

227-555-0168

WORKS WITH XBOX 360 AND PS3

Please *** Using these numbers may affect your ability to unlock certain achievements.

remember these cheas r for ps3
Putting cheat codes into Niko's phone in GTA IV:

Enter cheats during normal gameplay. Find the cheat you want to enter, activate Niko's cell phone and put in the numbers using the directional buttons. When the cheat is entered a message will be seen saying "Cheat Activated".