TL;DR
How to set up Yubikey for GPG and SSH
Yubikey
The primary feature of Yubikey is for 2FA authentication. If Yubikey is supported as a 2FA device, after you register it as a 2FA device for an application, Yubikey generates secure random string at the second step of 2FA authentication. But there is more what you can do with Yubikey. You could use it as a storage for SSH and GPG private keys. Using a Yubikey for GPG and SSH post provides information on how to set up your Yubikey for that purpose.