From a TV provider
If you pay for a TV service that gives you an Xtream Codes login or an M3U playlist address, add it in Settings › IPTV Sources, with Add Xtream Source or Add M3U Playlist. Gflix checks it with the provider before it's kept. A guide address (XMLTV) the provider gives you goes with the source, under its EPG Sources.
Choose a provider that holds the rights to the channels it streams. A service offering thousands of paid channels for very little almost certainly doesn't.