Using the User Interface (Button): In the Variables view, hover over a variable and click the inline Rename button (edit icon).
Using the Command Palette: Run AutomationView: Rename Variable.