How do I create desktop variables for "yourhostname" and "host"

I am new to grafana - I can create a grafana dashboard by downloading one - but I want to create variables and templates so that I can select different servers in my datasource and autofill yourhostname and host. I use netdata to an influxdb to grafana. Most of the tutorials I have found are for older versions of Grafana and don’t seem to work on the latest version.