Arduino to turn on PC using Opto-coupler help needed

Assuming you have wired your optocoupler the correct way, I don't see why it wouldn't work.

Use a multimeter to connect the two wires, check which side is positive, which side negative. Then you know which way to wire your optocoupler.

Use the multimeter to check whether the optocoupler is really on when you think it's on (set the Arduino pin HIGH, and measure the resistance - it should be low).

Try switching on your PC using a small resistor, 100-500 Ohm, to simulate the phototransistor in ON state, and tapping it to the pins you want to connect your optocoupler to.

If that works, try it again, now hold the resistor against the pins, see what happens (I expect it to switch off again after a few seconds).

Another thing, why would you use the TX pin of the Arduino, and not one of the normal digital pins?