If you'd like to enjoy a game or watch movie on your Xbox One console without being constantly disturbed by messages from your friends, there's a simple way to change your availability status on Xbox Live.
How To Go Offline in the Xbox One Friends App
Select the Friends tile, press the Start button of the controller and select Go full screen. This will open the Friends app in full screen mode.
Go to My Profile, click on Appearing online dropdown menu and select Appear offline.