To mirror your screen on a TV, showing all apps and screens you use on your phone, you must:
To start casting:
Go to Settings > Connected devices > Connection preferences > Cast.
Or, from quick settings, tap 
To stop:


You can cast an app if you:
Miracast is not supported.
To cast an app:
In a cast-compatible app (like YouTube), tap 
If you don't see 
While casting:

To stop casting:


If your TV supports Wi-Fi Direct, set up a connection between your phone and TV so that you can view or play media from your phone.
For information about using Wi-Fi Direct after you've connected, see the user guide that came with your TV.
After each step, see if your issue is fixed.
First, check the basics. Then:
Link the app on your phone to the app on the TV:

If you’re having issues casting with one of these apps, check their help center for troubleshooting information: