Risk limiting audits aka statistical sampling. There is no way to be absolutely certain the final count is 100% correct. Which is sorta okay most of the time, when the margin of victory is greater than the error rate.
Our FPTP voting system is the most brittle. 50% + 1 vote.
Election integrity would be greatly improved by switching to voting systems more resilient to errors. Specifically Approval Voting (or RCV) for single seat contests and Proportional Representation for assemblies.