Contact Salesforce to Enable the Apex Debugger

Some services and subscriptions include this feature for an extra cost. For pricing details, contact your Salesforce account executive. After Salesforce grants licenses for the Apex Debugger to your production org, match your production license counts to your sandbox.
User Permissions Needed
To match licenses to sandbox: “Modify All Data”

The matching process updates the license counts in your sandbox so that they match production. The process adds licenses to your sandbox that are in production but not in your sandbox, and deletes licenses from your sandbox that aren’t in production.

To match licenses to a sandbox org, log in to your sandbox org. From Setup, enter Company Information in the Quick Find box, then select Company Information | Match Production Licenses. This process triggers an alert informing you that the matching process has started. After all licenses have been matched in sandbox, a confirmation email is sent to you. The confirmation email is always sent to the user who initiates the license copy.

Matching production licenses requires that your sandbox and production orgs are on the same Salesforce release. If your sandbox has already been upgraded to the next release—for example, during sandbox preview—but production hasn’t been upgraded yet, you can’t match production licenses in sandbox.