I think you know about language C atleast a bit,if not then google for C tutorial before learning PIC programming using C.After that you will also need to know a bit about the architecture of the mcu so the best way is to go for the datasheet,you will get it form microchip's website.You are using 16F877 ,as per me you should use 16F877A that comes with a bit new features.