If a crank starts to come loose, it will quickly get damaged if the bike is ridden. Tighten the crank bolt as soon as you notice any play.

Most modern bikes have cranks held on with bolts that take a 14mm socket spanner or an 8mm Allen key.

You may have to remove a plastic dust cap first – unscrew it with a coin/screwdriver blade.  If there is not slot – flip it out with a narrow screwdriver blade. Remember to replace the dust cap afterwards.