As long as it's HDMI "High Speed" or "Premium High Speed" certified, it shouldn't make a difference. The HDMI spec was designed so that cable quality makes no difference to image quality.
A starting point might be Crucial's web site - you can put the laptop model in and it will suggest compatible memory kits (if you use their tool and they don't work, they'll take them back). It seems to suggest 2133MHz DDR3 SO-DIMMs, but the listing's a little confused (mentions DDR3 and DDR4) ...
Sounds like it's overheating. Check the intake/exhaust ports aren't obstructed, and then check for (and remove) any dust/lint build-up in the cooling ducts (intake/exhaust).
Logically, you want something like:
while (true)
begin
// Print options, read selection and act accordingly
end while
I'll leave how to code it and the body of the loop as an exercise for you :)
If you just want headphones, the Grado SR-60e (and 80e) are very good, although they (a) don't look great, and (b) are open-backed, so leak sound, have little isolation, but have a good "soundstage" (stereo separation).