Getting started with Terraform on Debian - simple steps

Install Terraform with package manager:

wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform
Check the version:
terraform version
Switch directory:
cd /tmp
mkdir simplefile
cd simplefile
Create a new file local.tf in that directory:
vim local.tf
With following contents:
resource "local_file" "pet" {
  filename = "/tmp/pets.txt"
  content = "We love pets!"
}
Run:
terraform init
After that:
terraform plan
and review the output.

And finally:
terraform apply
and type yes.

View the file:
ls -la /tmp/pets.txt
cat /tmp/pets.txt
To destroy this resource (delete this file) - run:
terraform destroy
and type yes.

File will be deleted.

Also, you can experiment by modifying the contents of the file and try plan and apply after that.