It tells you.
You have to install a separate add-on for 2021.
In ECMAScript 5.1 you can access the ThingManager. You’ll need to pull that service through the OSGI APIs. It would be something like
var FrameworkUtil = Java.type("org.osgi.framework.FrameworkUtil");
var _bundle = FrameworkUtil.getBundle(scriptExtension.class);
var bundle_context = _bundle.getBundleContext();
var ThingManager = bundle_context.getServiceReference("org.openhab.core.thing.ThingManager");
var ThingUID = Java.type('org.openhab.core.thing.ThingUID');
ThingManager.setEnabled(new ThingUID('thing:uid:string'), false); // disable Thing
