How can I program a pin to be an on and off switch of a cable?

I have a cable and want to turn it on and off without using a button, so I want to turn it on and off through programming.
Can you help me?
Thanks!

Not sure what you mean by turning on and off a cable.

Spend a few dozen more of your lifetime supply of words and tell us more about what you are up to, what you wish to accomplish.

a7

Cable has a lot of definitions and different ways to turn them on and off. Tell us what type of cable is it. What is connected at the ends. How much current and voltage is involved. etc... How do you want to accomplish the turning on and off, a switch, wireless, etc..?