My friend told me that I need a capacitor.
Probably been said a million times on this forum.
The problem is your amp is pulling more current than your car can provide. There are generally three remedies to this: Replacing your main stock wiring with bigger wire (known as the Big 3), getting a bigger/better battery, and/or getting a High-output alternator.
What car do you drive, and what is your setup?
I'd recommend the Big 3 and an Optima Yellow top. Since you're only experiencing this problem at idle, meaning when the alternator is putting out a smaller amount of power than at higher RPM, you don't need a ton of upgrades.
Here's the thread for the Big 3:http://www.caraudio.com/forum/showthread.php?t=152355
Do that, and it should solve your problems. If you still have issues, get an Optima Yellowtop or other big, deep cycle batter. If you STILL have issues, you'll need to get a highoutput alternator for your car. Iraggi, Mean green, and Excessive Amperage all make good products.