PWM light intensity techinque using microcontroller

I am currently working on a MM32F0020 microcontroller and has been given a task to perform PWM light intensity technique to the microcontroller , i am using keil software for this.I f someone has any example of PWM using any microcontroller it would be of great help if you can share or tell me some things about how to use it.