Usually the minimum sentence is 4 years in jail for using
drugs in the UAE (people can be convicted on evidence of drugs in their body, for example urine or blood test, even if the drug use happened outside the UAE). Note too that using some medicines without prescription in the UAE can get you into the same trouble (people have been arrested and convicted for having codeine in their system for example).
Longer sentence if convicted of dealing (I think maximum is death penalty but I haven't heard of that being carried out).
If someone is arrested, it's unlikely there's much you can do about it (see the link above to more information on some cases). Start with contacting the person's
embassy or
consulate - they won't help with getting out of jail but they should be able to at least suggest some lawyers.