Both hydraulics and pneumatics refer to confined, pressurised fluids. If the fluid is a liquid (like water or oil), then the machine uses hydraulics. If the fluid is a gas (like air), then the machine uses pneumatics.
Hydraulics
Since liquids are not very compressible, it means there almost no delay in moment i.e. and input force instantly actuates some output. Hydraulic systems require high-pressure liquid, usually via a pump.
Some examples of hydraulics systems include car brakes and cranes
Pneumatics
Gases can be compressed, which results in some delay in moment. Pneumatic systems require high-pressure air, usually via a compressor.
Some examples of pneumatic systems include air tools, nail guns, dentist drills.