0-1А adjustable current source IC for dimming battery powered LED
Adjusting LED brightness is a very common problem, and there are a lot of ready-made solutions. If you want, you could roll your own with a simple mosfet and PWM with a microcontroller, or you could go down the route of using a monolithic IC to do it.

If using an IC, you can either go for linear (not really recommended because you'll be dumping a fair amount of heat) or a switched mode like mic2298.

You could also just buy one like this. You'll probably want to switch their potentiometer with a nicer one.