Software is code that allows a device to carry out a process or function. Hardware is the physical device that is designed to perform the tasks instructed by software. 

The best example of this is a smartphone and a mobile app. The smartphone is a hardware device that runs software i.e. the mobile app.