You need to meet these requirements first: Requirements for G-Sync
G-Sync Monitor list: https://www.nvidia.com/en-au/geforce/products/g-sync-monitors/specs/
You need to force CoD4 to run in full screen mode (ideally borderless).
If your monitor runs at a refresh rate below your input FPS: You need to lock your games framerate to a value just below the maximum refresh rate of your monitor. E.g. if your game runs at around 150-180FPS, and you own a 144Hz monitor, you need to lock it down to say 135-141Hz (140).
Use the Program Settings in Nvidia Control Panel to do this or as a console command: /com_maxfps "x" where x can be any value from 1 to 2147483647 (the game's physics start to break at 250+ FPS).
Bonus: 2147483647 is the eighth Mersenne prime
If your monitor can run close to your input FPS: E.g. your input FPS is between 150-180FPS, and your monitor can run at 200Hz, then you just need to enable G-Sync in your N Control Panel for your monitor.