how to code on Arduino Uno to switch on/off 12v 2pin fan?

i have connected red from fan to NO relay contact, red from 12v psu to C(common) contact.The black from the fan goes direct to black-12v of psu.

after connecting it how to code on arduino?

Picture of how to code on Arduino Uno to switch on/off 12v 2pin fan?

Define an IO pin as an output, send a true or false argument to the pin.

So you are a computer science student who can't program either?

iceng2 years ago

First you might consider going back to your previous questions and assigning the Best_Answer to whoever you believe answered you best.

I am a simple guy and would just use a switch, for more there are the Arduino pages with their code references.
If you fail to program a simple on-off command you should start with the basics and read up on some Arduino tutorials.