Queries in RTL are methods that allow you to assert/find elements in a DOM while using tests. There are two types of queries that should be used for different purposes.

queryBy/AllBy

if you want to assert non-existence of an element you should use queryBy/allBy because it returns an array of elements and you can just check the length of an array. This will avoid breaking your tests.

findBy/AllBy

If you want to assert element that you know 100% that it exists, you should use findBy/AllBy, because it returns elements. This will break your test if elements do not exist.