Many inventors throughout history have tried to create so-called perpetual motion machines, which will continue to operate (regardless of friction) or even generate energy indefinitely out of nothing. Such a machine would be extremely useful, which is why people continue to try to invent and patent such machines. However, such a machine violates the First Law of Thermodynamics: for a machine to output energy, it either needs to input energy from somewhere else (e.g. from a solar panel), or its own energy supplies need to dwindle. A battery is an example of the latter case, and while a battery-powered car might have seemed like perpetual motion to early physicists, we know that the car will not drive forever without a replacement of batteries.
Some inventors, accepting that you can't get something for nothing, turned their eyes on a source of energy that is all around us: thermal energy. All the objects around us have molecules that are randomly vibrating and moving. If I place a machine next to something that is hotter, can that machine harness that heat to do something useful? Can we turn heat into work?
Surprise! Yes we can. In fact, the vast majority of our machines are powered, directly or indirectly, by so-called heat engines. However, there is a price: you can't convert all of the heat that flows into work: some of that heat must flow out of the machine, which means in addition to something hotter than the machine you will also need something that is colder. The percentage of heat which can be converted into work depends partly on the difference between these two temperature extremes, but it will never be 100%: this is called the Second Law of Thermodynamics.
Some inventors have claimed to have built machines which are able to convert 100% of heat into work; such purported devices are called perpetual motion machines of the second kind. None have been proven to do what they say, and again, producing such a device would require us to seriously rethink what we know about physics.