sudo apt install python-rpi.gpio
nano relayon.py

import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(16, GPIO.OUT) #Change 16 If Needed
GPIO.output(16,1) #Change 16 If Needed
nano relayoff.py

import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(16, GPIO.OUT) #Change If Needed
GPIO.output(16,0) #Change 16 If Needed
python relayon.py
python relayoff.py