Start off by installing Grasp.
Next, read over the concepts behind Grasp.
grasp --help, or check out the options page, and get a feel for the program.
Once you’ve expiremented with that, take a look at squery and try some more complicated searches.
Finally, use what you’ve learned and try to replace one of your searches.
If you are really curious, and are considering developing a tool that uses Grasp, learn how to use it as a library.