Obviously, there is never full certainty. Sometimes I wonder if I can be sure that I read and copied something correctly even though I don't have dyslexia. If I remember correctly, there was a discussion about this in the science fiction novel
Solaris by Stanisław Lem where the protagonist was wondering if he went crazy and can trust the reading of instruments on a spaceship. He ended up performing a complicated computation on the computer that got confirmed by an experiment (or was it? I don't remember very well), so he knew that what he saw was not a hallucination because his brain would not be able to perform such computation.
Some proof assistants have a so-called kernel where the rules of mathematical reasoning are programmed. Ideally, the number of such rules is quite small. The rules of type theory (an extension of lambda calculus) can be written on one page. In a real proof assistant they may be more complicated, but hopefully it's not hundreds of pages. Then all reasoning that the proof assistant verifies gets channeled through this kernel. This is called de Bruijn principle.
A proof assistant can have a lot of facilities built on top of the kernel: means of syntax extension, decision procedures for certain class of formulas, ways of guessing implied parameters (e.g., we often refer to the field of reals just by mentioning the carrier, and the operations and axioms are implied) and so on. But everything is broken down and eventually fed through the kernel. If the kernel says OK, the proof step is accepted. If there is an error either during the breaking down stage or in the kernel itself, the step is rejected. Therefore you know that as long as the kernel is correct, the proof is sound.
By design, people try to make kernels small. In
HOL Light, for example, it consists of fewer than 500 lines of computer code, so it is realistic to examine it manually or even formalize in some other proof assistant. Besides, the idea of
formal methods is that the rules programmed into the kernel are not just invented for convenience, but form a nice mathematical object (such as Zermelo–Fraenkel set theory). This object is also extensively studied in mathematics to make sure that it does not give rise to contradictions.
I highly recommend a
special issue on formal proof of the Notices of the American Mathematical Society (Volume 55, Number 11). Here is a quotation by Thomas Hales from the first article.