How do you tell which ion in a compound is oxidized or reduced?

Write the balanced equation for the half reaction that takes place at the anode. I do not understand how to tell the difference in what’s being oxidized (anode ) and what’s being reduced (cathode). Please help!