A lthough you can attach a Speedlite to the camera’s hotshoe where available (not all EOS M cameras have one), taking the light off the camera and positioning it somewhere interesting is the goal. To do this, however, you will need a way of controlling the flashgun remotely and triggering it when you shoot.
There are two ways to do this: using a wired connection or going wireless. A few years ago, we would have happily recommended the wired route, using an off-camera shoe cord. One end of this cable attaches to the hotshoe on top of the camera, while the other end is fitted with a hotshoe that the Speedlite slots into. While they’re okay for close-up photography, they can be a proper trip hazard for longer distance work.