When you develop new Terraform code, and you're ready to test it out, the first thing you need to do is run terraform init in order to initialize the working directory and download any required providers or referenced modules. Even if you're in a directory that has some of these plugins, you should still run terraform init to make sure all the providers have been downloaded. You could even run a terraform init -upgrade to ensure you have the latest versions of the plugins that meet your requirements.
WRONG ANSWERS:
None of these commands would work if you haven't initialized the working directory yet. You would get an error similar to this:
│ Error: Could not load plugin
│
│
│ Plugin reinitialization required. Please run "terraform init".
│
│ Plugins are external binaries that Terraform uses to access and manipulate
│ resources. The configuration provided requires plugins which can't be located,
│ don't satisfy the version constraints, or are otherwise incompatible.
│
│ Terraform automatically discovers provider requirements from your
│ configuration, including providers used in child modules. To see the
│ requirements and constraints, run "terraform providers".
│
│ failed to instantiate provider "registry.terraform.io/hashicorp/aws" to obtain schema:
│ unknown provider "registry.terraform.io/hashicorp/aws"
https://www.terraform.io/cli/commands/init