Computers work by processing binary code consisting of 0s and 1s. They use these binary digits to perform calculations and execute commands.