A network that does not broadcast its name is the one case where a normal netplan Wi-Fi config can fail. The fix is a single key under the access point.
network:
version: 2
wifis:
wlp3s0:
dhcp4: true
access-points:
"my-hidden-ssid":
password: "correct horse battery staple"
hidden: true
The keys under access-points are SSIDs. Per the reference, hidden changes the scan technique for hidden networks and defaults to false. It exists since netplan 0.100. Replace wlp3s0 with the name of your Wi-Fi interface, which ip link shows.
Two related keys are worth knowing. band takes 5GHz or 2.4GHz, and channel only takes effect when band is set as well. Both are available since 0.99. Without a password or auth the network is treated as open.
Two caveats. The docs say that setting hidden: true for a network that does broadcast its name may be slower, so leave it off unless you need it. And the passphrase sits in the YAML file in plain text, so keep that file readable for root only.
After editing the file, sudo netplan try applies the config and rolls back if you do not confirm, per the netplan docs, if you do not confirm within a time limit. The default is 120 seconds and --timeout changes it. That helps when a typo would cut off your only connection. Use sudo netplan apply once you are happy with it.
Further reading: Netplan YAML reference