so you have the pic output that switches the optocoupler, no should i put a resistor between the pic and the optocoupler and then the optocoupler switches the transistor and I dont have any idea how to wire that part
Your resistor value should be selected to ensure the optocoupler has the correct forward bias voltage across it. Without knowing the specifications of the optocoupler or the voltage you are using, it is unlikely that anyone can tell you the exact resistance value you need.
If you want to control 220VAC then just buy a solid-state relay of the appropriate output current capacity. These consist of an opto isolator and a switch in one module. They typically require 10-20mA of dc to turn-on so you may need to add a transistor at the PIC output to provide this current.