Produce loud noise for a security alarm
A speaker by itself will not do anything.  It would require an oscillator circuit to drive it to make a noise.  The same goes for a simple piezo element.

You can buy ready-made buzzers, which just need to be connected to a power supply to work.  These come in a variety of sizes and loudnesses.  Sime will just buzz, others have multi-tone hooters.