How to turn lights on and off using a computer

I was watching a YouTube video on how computers were becoming a rage in the ’80’s in the first world countries. At 11:57, the user has programmed the computer to turn several appliances at his home on automatically in the middle of night. Similarly, at 13:58, the man uses voice commands to turn his lamp on and off. I want to know how (and if) I can achieve these tasks (especially the first one) using a modern day pc/laptop. I have seen several videos where people use Arduino or Raspberry Pis to achieve this. I want to know if I can bypass these devices.

Side Note: I am a beginner in programming but can write Python scripts to automate some of my stuff.