What would be the best way to update R and RStudio in Windows?

Try this code:

install.packages("installr")

library(installr)

updateR()