Using the User Interface (Button): In the Variables view, hover over an unused variable and click the inline Delete button (close icon).
Using the Command Palette: Run AutomationView: Delete Variable.