To Restrict access to registry local
Firstly, check the local admin group to make sure you are the only one who has the local administrator privilege.Secondly, update this Group Policy to restrict access to Windows Registry editor Regedit.exe. You can do this by
1. Press WIN + R, type gpedit.msc, and click OK to launch Local Group Policy Editor.
2. Navigate the left panel to User Configuration → Administrative Template → System
3. Double click Prevent Access to Registry Editing Tools at the right panel, click the Enable radio button, and click OK to save the settings.
Now, when anyone, including yourself, using your PC attempting to launch the registry editor, they will get message telling them that the registry editor has been disabled by administrator.
To undo this to regain access to the registry tool, repeat the same process to disable the setting.

