This article explains how to turn off Active Status on Facebook Messenger so others can’t detect that you’re online. This is useful if you receive a lot of distracting messages.
You can make Messenger accessible only to specific Facebook friends, while appearing offline to everyone else. You can also hide Messenger from all of your Facebook friends and contacts.
When you turn off Active Status, you can receive messages, but you won't be notified about messages. Anything you receive while Messenger is off will appear in your inbox when you turn on Active Status.
Follow these steps for both outcomes: