You can easly control the current running through your LED by adding a potentiometer as part of your circuit.
To control the LED with Arduino programming you attach the potentiometer to your analog in and let your Arduino program decide how much to dim the LED depending on the input you get from the potentiometer.
The input from analogRead returns a value between 0 and 1023. The analogWrite takes values between 0 and 255. The code below show you have to convert your analog in value to make your LED shine as bright as possible when the potentiometer is fully on.
int ledPin =3;
int potentiomenterInput =0;
potentiomenterInput =(analogRead(0)/4);// Divides input 0-1023 to resemble to 0-255
// The delay can be change to get the desired dimming effect