A computer consists of hardware and software. Without either, there’s no computer. Hardware itself is mechanics and electrical signals (mainly the latter today) – hardware doesn’t talk “human” – there’s nothing on your screen with just hardware, there’s no files, there’s no keyboard, letters – all of that is software. Software defines this – software is what defines what a file is, what the letter A looks like, knows how to make the hardware understands when you write 10+10, so it can do the calculation. It’s all software.
But most programmers (very few do) today write the code at this low level. The interface between the application software you use and the hardware is the OS. The programmer builds on the OS, not the hardware. And because there are so many different kinds of hardware, the OS also allows the same program to run on lots of different hardware platforms, as the OS abstracts the complexity from the programmer.
All of that, and more, you can find on lots of web sites, in books etc. If this subject has your interest, I highly recommend starting there. You’ll get a lot more than these short reddit replies to help you understand both hardware and software.
Latest Answers