Iz, all answers given here are correct

Just to more precise, the pins do indeed prevent the landing and take-off gear(s) to retract when on the ground. All the biggies have hydraulic systems, which when on, maintain the locking cylinders of the gear(s) pressurized (not talking about the extension/retraction cylinder here, those are , on most aircraft, pressureless once the cycle is done). So, no hydraulic pressure, and the gear "could" retract, e.g. during the towing of the aircraft or when subjected to strong (gales) winds. The pins then also prevents engineers (or pilots under instruction

...) from selecting the gear to up by mistake.
Thanks for reading my pinch of salt...
------------------
... cut my wings and I'll die ...