Use GPIO pin of PIC on a general way and also with a led
Because the microcontroller output is a voltage source, you should connect the other item in parallel with the LED:







simulate this circuit &ndash; Schematic created using CircuitLab

Notes:


The above presumes that you want the LED on when the other load is high. If you want the opposite behavior, flip the diode and connect the anode to the supply voltage.
Be careful to not exceed the maximum current rating for the pin.
The pin cannot simultaneously be an input and an output.