This applies to Covid-19 testing done in Aotearoa New Zealand, but tests elsewhere may well use the same methods: Coronavirus testing - how does it work?.
Some excellent videos of how a nasal swab is done and how samples are processed. Great informative science article. 🦠