The command which you asked works if you have rate-mirrors on your system. So you need to have rate-mirrors on your system.
If you want to go via reflector, then run
score | sudo tee /etc/pacman.d/mirrorlist
Or the first command in the which was shared in that post.
You need to run this command in terminal, and the write-up process will happen over there eventually.
There is another similar post,which provides slight more info :