If the system is registered to Red Hat Satellite Manager run below commands
# subscription-manager clean
If the system is registered to Red Hat Network Classic method then remove or move the systemid file from /etc/sysconfig/rhn/systemid to some other location
mv /etc/sysconfig/rhn/systemid /tmp/ or rm -rf /etc/sysconfig/rhn/systemid
Once the system is unregistered then clean yum cache:
# rm -rf /var/cache/yum/* # yum clean all
This will remove the server from Red Hat Network and remove redhat.repo from /etc/yum.repos.d/ as well.