In order to start Miracast on the LG G5, first go to Settings -> Networks -> Share & connect -> Screen sharing. At the same time, make sure to turn on WI-FI if it's not already on.
The phone will then start to detect any Miracast-supported displays nearby, where you can see the Samsung K4300 Joy Smart TV as 'Samsung 4 Series (32)'. Select this TV to start the screen mirroring connection process.
Once screen mirroring is successful, the LG G5 will immediately get connected to the TV, and the phone's screen will be displayed.
The LG G5 works well with the Samsung K4300 Joy Smart TV using Miracast technology, which gives you the convenience of being able to wirelessly display your phone's screen to a larger display but don't expect to use it for long periods of time when watching fast action movies or playing games.