You can't directly logout of WhatsApp on iPhone or Android, but you can delete the app or clear its data to essentially accomplish the same thing.
Your WhatsApp account could be compromised. Learn how to detect unauthorized access by checking linked devices and suspicious activity. Secure your chats and personal information by enabling security ...