To replace a starter relay, first, locate the relay in your vehicle's engine compartment. Disconnect the negative battery cable to ensure safety. Then, remove the old relay by gently pulling it out of its socket. Finally, insert the new relay and reconnect the negative battery cable. Test the starter to ensure it is functioning properly.