This is one of the greatest differences between popular history and academic history. The manner of teaching history as a series of names, events, and dates utterly misses one of the core skills of actually doing history. Imagine if mathematics were taught without showing you how brackets or exponents work. Up in the ivory tower in academia-land, yes, the actual, Capital-H Historians are quite aware that people lie, and that sometimes people lie in writing. (Sometimes people even lie on stone carvings. The Daiva Inscription straight-up says "And there was something else, that had been done wrong, that too I put right." - without being specific about just what it was that Xerxes put right.)
See, history deals with humans. History is created by humans, written by humans, written for humans, studied by humans, interpreted by humans, read by humans.
The inherent problem here is that the human is a stupid, selfish, blinkered creature with entirely too many prejudices, preconceptions, and biases, and a very sharply limited point of view. It is perfectly possible for a human to give a completely inaccurate picture of what is going on without even lying. Historians know this. It's part of the job. It's one of the hazards that the trade deals with, much like restaurant back-of-house deals with the hazards of knives and stoves.
Fortunately, there is such a thing as the historical method, the same way as there is a scientific method. Here are some previous threads for you to consider:
Also, see next post.
Besides the great answer by /u/DenKensington, I wish to add that I'm not so sure that there is an assumption/presumption that written sources are more reliable than oral. Both require source criticism while taking into account the context. Since the sources are inherently different, we approach them differently (this is true even among the vast possibilities when it comes to written sources), but we also approach them with an attempt to understand the context, which can affect the source criticism that is applied.
Suppose we had two former rulers of some nation. One was a notorious and well-known liar and the other was known for a consistent effort to tell the truth - and even circumspection when it comes to how subjectivity might affect perception of something that happened, and so the honest ruler cautions everyone to understand the context.
The liar writes an account of something and the honest ruler describes the same thing, but this second ruler tells it to a reporter.
Context is everything, and a careful evaluation of these two sources will judge them based on the way the information was transmitted and on the context of the nature of the authors of those words (one written and one oral).