To prevent RStudio from hanging when GitHub copilot was in use, I switched off automated copilot completions by going here in RStudio:
Tools --> Global Options --> Copilot
Then, I left Enable GitHub copilot
ticked, but switched Show Copilot code suggestions
from Automatically
to Manually (Ctrl + Backslash)
.
This means that whenever I want to use completions, I can just press Ctrl + Backslash after the comment/ instruction / piece of code.