How are minute quantities (like milligrams, micrograms, or nanograms) weighed?

Down to milligrams one can use well-designed physical balances-indeed one can even o below one milligram if proper isolation from vibrations and other disturbances is ensured. But for going lower one needs to use other methods. We have to remember that our objective is to measure the mass, which is the quantity of material and not the amount of gravitational force. Mass is a measure of inertia.

Inertia of an object is its intrinsic property that does not change whether the object is on earth, on the moon or orbiting in a weightless condition in earth orbit.
One technique for measuring small masses that has become very current is to measure the change in resonant frequency of a quartz crystal on which the mass to be measured is deposited. Such crystals are piezoelectric, implying that a change in their dimension produces an electric potential across them.
The reverse also happens; for example an oscillating electric field would introduce a physical oscillation of the crystal. The crystal, being mechanical in nature, also has a natural vibration frequency that depends on its dimensions and mass. If the electrical frequency is the same as the mechanical vibration frequency of the crystal there is a resonance that can be detected by a properly designed circuit. In this way the slightest change in the mass of the crystal can be measured.