Building a filter

I’ve had time to get more acquainted with the dev kit now and I would like to try to build a filter to dim the lightbulb. I’m quite new to Arduino programming, so any help regarding how to get going constructing a filter would be appreciated!

//Albin