The examples you gave are all using counters (example: san MAI - mai is the counter for flat things, ko is the counter for small things, ect) I had to memorize them separately to get any good at them, and there are many different ones.(there's one specifically for animals, and long thin objects and others)
Essentially use the counter that best describes the object you want to count.