How Do I Remove Domain Controller From Active Directory In Windows

I urgently want to remove domain controller from active directory as I have made some changes to the directory and my previous domain controller is not being accepted. I am seeing continuous errors and I think this is lagging my system. Can anyone help me with this?
