Once you hold example.com you control everything to the left of it. Creating a subdomain is just adding a record, for instance an A record for blog.example.com or a CNAME for shop.example.com, and you can go several levels deep (api.eu.example.com). Each subdomain can point to a different server or provider.
A subdomain can also be delegated: by adding NS records for it, you hand a whole branch, for example dev.example.com and everything below it, to other nameservers that are managed separately. A wildcard record (*.example.com) answers for every subdomain that has no record of its own.
Strictly speaking www is a subdomain like any other. Two practical cautions: cookies and TLS certificates are scoped by hostname, so each subdomain must be covered by a certificate, and a CNAME left pointing at a cancelled third-party service can let someone else claim that service name and serve content on your subdomain (a subdomain takeover). Remove DNS records when you retire the service behind them.
Example
blog.example.com. 300 IN A 192.0.2.20
api.eu.example.com. 300 IN CNAME lb.hosting.example.