Having your bike stolen is horrible. Don't let it happen by following these easy tips:
Buy a good quality D-lock (sometimes called U-locks) that meets the industry standard for your location and use it with a cable extension (most locks come with one of these)
Lock your bike to something fixed - ideally a bike parking stand but otherwise sturdy railings or a street sign - in a public place with lots of people nearby, if at all possible
Secure all the parts by making sure that the rear wheel, frame and whatever you are locking your bike to are all in the 'D'. Use your cable extension to secure your front wheel (and helmet, if you want to leave it with your bike). This short video from our friends over at Cyclehoop shows you how: