How to use query editor in custom module?

I’ve seen Paged custom query this post and maybe @JonL have something to share? Or I go along with just a text field, I don’t know