There are Youtube videos showing how to make one but they're so cheap to buy you may as well buy a new one. There are a few types so they are not universal as such so it's important to know which one will work for your treadmill. They are nearly all magnetic but some will fit certain treadmills and not others. The magnetic part creates a circuit which enables the treadmill to function.
The reason I say they're not universal is that although they all work using a magnet, some have a slot that you put the key into. Others have a metal disc that you put the key onto. The metal disc is the most common and will work with a variety of treadmills. I will post a picture and a link to where they can be bought from. Amazon is the best place.