Rate of false positives/negatives in COVID/other tests

How is the rate of bad results determined in new tests for any disease?

Bonus if you can explain the different types of tests and why the rates of bad results might differ across them.

Sorry if this is a duplicate, I did look, but maybe I missed it.