To log out of Facebook Messenger, open the Facebook app (not Messenger), go to the menu, then tap Settings & Privacy > Settings > Security and Login. Under Where You're Logged In, find the device with Messenger active, tap the three dots next to it, and select Log Out. This will log you out of Messenger on that device.