There are two common uses for subdomains in WordPress: multisite and subdomain categories.
Subdomains are usually the preferred network structure for WordPress Multisite. You can make this selection in the configuration of your multisite network — just follow the options.
For using subdomains as categories, you’ll need a plugin to do that.
In both cases you will also need to set up a DNS CNAME record for a wildcard subdomain. The domain name for the CNAME record will be *.example.com and the address will be the base domain name, example.com.