Example for the number $19$ : The order of $10$ modulo $19$ is $18$, therefore you can divide the given number into $18$-digit-blocks from behind. The first block usually will have less than $18$ digits. Then, you can sum up the residues modulo $19$ of those blocks (considered as a natural number) and the given number is divisible by $19$ if and only if the sum is divisible by $19$.
A bit easier to use is the following rule : Divide the number into $9$-digit blocks from behind, the first block usually will have less than $9$ digits. Then, begin with residue modulo $19$ of the first block, then subtract the residue of the next, then add and so on. The given number is divisible by $19$ , if and only if the final result is divisible by $19$.
Example : $$5645012950185238747288629$$
Dividing gives $$5645012\ 950185238747288629$$
$5645012$ has redisue $17$ and $950185238747288629$ has redisue $2$ , the sum is $19$. Hence , the given number is disible by $19$
$$5645012\ 950185238\ 747288629$$
If we divide in $9$-digit - blocks, we get the residues $17,7,9$ and $17-7+9=19$ which is divisible by $19$, hence the given number is disivible by $19$.