Blocking bad bots or user agents is as simple as adding the following code to your .htaccess file:
BrowserMatchNoCase "mj12bot" badbot
BrowserMatchNoCase "dotbot" badbot
BrowserMatchNoCase "gigabot" badbot
Allow from ALL
Deny from env=badbot
You can replace or add "BrowserMatchNoCase "mj12bot" badbot" lines with the bot user agent you want to block.
Note: .htaccess is a system file, so it does not appear by default in cPanel's File Manager. You would need to update your settings to "Show all files" in File Manager to see it.