Facebook chat can be disabled on the site for some or all of your friends; to do this, you need to change the chat settings in the chat window. On mobile devices, chat is supported by the Facebook Messenger app; to change your status to "offline", click on the slider on the "Online" tab of the "Contacts" menu.
Steps
Method 1 of 2: In Messenger

Step 1. Launch the Messenger app
If your device doesn't have it, download it from the App Store or Play Store.

Step 2. Log in to your Facebook account
Enter your username and password and then click Login.

Step 3. Click "Contacts"
The icon for this option looks like 3 horizontal lines with dots and is located on the bottom menu bar (iOS) or the top menu bar (Android). A list of contacts will open.

Step 4. Click "Online"
This tab is at the top of your contact list.

Step 5. Tap the slider next to your name
It will appear at the top of your contact list. The slider will turn gray (on iOS) or disappear (on Android) - this means that you are not visible on the network (your status has been changed to “offline”).
Tap the slider again to appear online (on iOS). On Android, tap the Home tab, swipe down from the top of the screen to refresh the list, and then tap Turn on when prompted to go back online
Method 2 of 2: Online

Step 1. Open the Facebook site
Go to

Step 2. Click on the chat window
It's in the bottom right corner of the page.

Step 3. Click on the gear icon
It's in the upper right corner of the chat window.
In some cases, this icon is located in the lower-right corner of the chat window

Step 4. Click "Turn off chat"
A window with options for disconnecting chat will open.

Step 5. Check the box next to the required option
You can choose one of the following options:
- "Turn off chat for all contacts";
- "Turn off chat for all contacts except";
- Turn off chat for some contacts only.

Step 6. Enter your friends' names in the text box (optional)
If you want to turn off chat only for certain friends, a text field will appear in which you need to specify for which friends the chat will be disabled (or vice versa enabled).
Facebook will automatically fill in the name as soon as you start typing it

Step 7. Click on "OK"
Facebook chat will be disabled according to the selected option.