If your original unit is damaged or missing and you are fitting an after-market switch you may need some additional parts.
When I was building my project bike, these are the additional parts I needed to properly fit the switch. It is more than likely that you will already have these on your TTR.
First off was to fit a new rubber grommet on the RHS of the bike - part # 90480-24222.
The wires are soldered onto the original Yamaha switch. The after market switch needs a couple of ring terminals to be fitted to the connector lead as per the pic below:
The switch is a snug fit in the frame grommet. The switch's backing nut that sits inside the frame has to be wound in or out to get the right amount of thread protruding to fit the retaining ring such that the switch is flush.
It is then just a case of screwing on the retaining ring. I did mine up hand tight and has been perfectly OK.
Moving around to the LH side, I fitted a new cover - part # 4GY-82568-01-00. I needed to use a bit of gentle persuasion to make sure the wires fitted into the cover neatly. There is quite a bit of spare cable so it was then just a case of plugging the switch terminal block into the loom.
Job done!
All works fine and I have done about 600 miles on the project bike since fitting the ignition switch