On a command line(Win, Mac, Linux), type youtube-dl followed by pasting the m3u8 link, then enter.
Of course you should already have youtube-dl installed.
If above doesn't work, you can download the m3u8 file. Look inside the m3u8 file, if it contains relative links to ts file for example:
You need to replace this relative link with absolute link by adding hostname, for example, if you downloaded the m3u8 file from https://example.com/, you need to insert 'https://example.com' before every ts lines, so the above will be like:
You need to do this to all lines that contain ".ts".
Save the file, then:
ffmpeg -protocol_whitelist file,http,https,tcp,tls -allowed_extensions ALL -i playlist.m3u8 -bsf:a aac_adtstoasc -c copy out.mp4