You can log out of messenger easily using the Facebook application. Open the Facebook application and click on the menu section. In the menu section, click on "settings and privacy" option. Then you will see security option and click on it. After clicking on security option you will see "where you have logged in" option. In that section you will all the devices on which you have logged in. Select any device and click on log out option in the three dots.
For more information: https://worldzo.net/log-out-of-facebook-messenger-on-android-iphone/