Cholinergic drugs work by enhancing the action of acetylcholine. Direct-acting cholinergic drugs, like pilocarpine, directly stimulate acetylcholine receptors. Indirect-acting cholinergic drugs, such as pyridostigmine and neostigmine, inhibit the enzyme acetylcholinesterase, thereby increasing the levels of acetylcholine at synapses. This enhancement of acetylcholine activity leads to increased stimulation of the parasympathetic nervous system, resulting in effects like increased muscle contraction, enhanced gastrointestinal motility, and pupil constriction.