It depends upon the reaction whether a substance acts as a reducing agent or oxidizing agent.
Generally, oxidizing agents themselves get reduced or accept electrons. Non-metals have a greater tendency to accept electrons so more probability is that they can act as oxidizing agent.