Make sure you have access to GitHub Copilot.
Install the GitHub Copilot plugin for JetBrains
After GitHub Copilot is installed, click Restart IDE.
After your JetBrains IDE has restarted, click the Tools menu. Click GitHub Copilot, then click Login to GitHub
In the "Sign in to GitHub" dialog box, to copy the device code and open the device activation window, click Copy and Open
A device activation window will open in your browser. Paste the device code, then click Continue.
GitHub will request the necessary permissions for GitHub Copilot. To approve these permissions, click Authorize GitHub Copilot Plugin.
After the permissions have been approved, your JetBrains IDE will show a confirmation. To begin using GitHub Copilot, click OK.