Ok you bought you brand new (or used) Action Replay. Sweet! Now how do you work this thing? Well heres all you need to know to use and enjoy your Action Replay.
Alright. When you first use your action replay, it has a list of codes already on there. Heres a video of how to use codes on a game.
Video:
Now that you know how to use the Action Replay, you need more codes. Lets say you have Pokemon Diamond. Well the cheats provided are not the best ones. There are two ways to add codes. Manually and using the computer. The easiest way is using a computer. To add codes you need the Action Replay Code Manager. If you don't have it, you can download it for free HERE
Now that you have the program, its time to add some codes. If your AR says "Unknown Game" when you insert Pokemon Diamond or Pearl, you need to add it. First, put you AR in and turn it on.
Select "Add New Game".

Now put in what you want the game to be called. (I put Pearl because thats what I have)

Now the important part. You have to input the game ID. The Pokemon Pearl code is APAE-31D0AFDE Include the dash! The Pokemon Diamond codes is ADAE-636791c0. This is very important that you do it correctly. 
Now you have it all set up! Now what about those codes?
Now the good but confusing part. Loads of people don't get it. If you learn it step by step, you be adding codes in no time!
First you need to find codes. I usually google something like "pokemon pearl action replay codes" or "action replay ds codes". Other places you can get them are supercheats.com, cheathappens.com, neoseeker.com, and others like them.
1.Copy the code.
2.Open the Action Replay Code Manager.
3. Create a new folder.
4.Connect your action replay to your computer.
(For those of you who don't know how just put the little end in the AR and the fat end in a USB slot in your computer.)
5.Drag the game from the section labeled "Nintendo DS" to the folder.
6.Right click the game in the folder and select New Code.
7.Name the code whatever you want and paste the code in the box.
8.Click ok and then drag the game back into the Nintendo DS section.
8.It will ask it you want it to overright. Click yes and your done!
Video: