When prompted with a QR code, use the QR scanner within WhatsApp to scan it.
To do so, open WhatsApp on your phone.
On Android: in the Chats screen > More options > WhatsApp Web.
On iPhone: go to Settings > WhatsApp Web.
On Windows Phone: in the Chats screen > go to Menu > whatsapp web.
Scan the QR code on your computer screen with your phone.
To log out of Desktop from WhatsApp
Go to WhatsApp on your phone > Go to Settings or Menu.
Tap WhatsApp Web > Log out from all devices > Log out.
If you believe someone has scanned your QR code and has access to your account via WhatsApp Web, use the instructions above to log out of all your active web sessions in WhatsApp on your mobile phone.
Note: If you're unable to scan the QR code, ensure that the main camera on your phone is functioning properly. If the camera isn't able to auto-focus, blurry or is broken, you may not be able to scan the barcode. Currently, there's no other way of logging into WhatsApp on your desktop.