The best way to learn is by studying an
example, changing it a little, and then running it with the simulator or a test circuit to see what happens. The PIC datasheet contains all information needed for building a test circuit, and reading it is a good way to learn about how the PIC works, too.