RStudio is an interactive desktop environment, but it is not R, nor does it include R when you download and install it. Therefore, to use RStudio, we first need to install R.
For windows go to https://cran.r-project.org/bin/windows/base/
For macOS go to https://cran.r-project.org/bin/macosx/
If you are using a macbook with apple silicon (M1), you should download R-4.2.1-arm64.pkg, however the non native R-4.2.1.pkg will also work. In case there are issues with your installation of the arm64 branch, try the non native version.
Accept all defaults during the installation of R.