I think you've explained it quite clearly.

First, you need to go to the Microchip site and download the datasheet for the specific chip you're using. Read through it noting what registers if any need to be set for the chip to work.

I'd then recommend you search this forum for simple programs to blink and LED on pin b.1 to ensure you're communicating with the chip.

Then, search this forum for PWM, Pulse Width Modulation, and use those posts to write your own code.

Once that's done post your code and your schematic along with chip number, PBP version and most everyone here will help you to "fix" your errors.

I look forward to hearing from you.