From as far back as 1406 BCE, we have had a system for checking Torah scrolls against that written by Moshe's own hand.
The Torah scroll consists of 304,805 letters. After 3400 years of textual transmission, we find differences in only 9 of those letters, which amount merely to spelling variants (no change to the meaning of the text). Those 9 variants differentiate the isolated Yemenite tradition from the "checked" tradition.
There are specific aspects of the Torah scroll which must be copied precisely.
Though the original practice was for every Jewish male (or perhaps every one of those who knew how to write) to write a Torah for himself, the integrity of the Torah has been protected by the development of a scribal tradition requiring a scribe to be specially trained in over 3000 rules for the writing of a sefer Torah. The command to write one's own sefer Torah is said to be satisfied by the writing or even the mere correction of even one single letter in the scroll.
A later ruling allows for one to pay a scribe to write the entire scroll on his behalf, or even to purchase a scroll in order to qualify as having fulfilled the mitzvah.