On WhatsApp Web or Desktop, open the menu and choose Log out. From your phone, go to Settings then Linked devices, tap the device, then Log out. Simple, quick and keeps chats private.
For WhatsApp Web or desktop, open Settings, Linked devices, tap the device, and choose Log out. On your phone, there's usually no button yet, though some Android users now see Log out under Settings, Account.