Some Cures for Melancholy

The doctors of physic, however, were some way ahead of the literary men. Medical practice was still founded on the theory of the four humours of the body, sanguine, bilious, phlegmatic and melancholy, and it was believed that most bodily illness, not obviously due to an external cause, was the result of excess or deficiency in these four essentials. With the substitution of glands for humours, modern physicians have come back to a similar position.
 - G.B. Harrison, "On Elizabethan Melancholy", in Nicholas Breton, Melancholike Humours, Scholartis Press, London, 1929. pp.56-57.

The proportions and distribution of the humors were believed to be the determining factor not only for a person's psychological penchants, but also for the body's strength or weakness. There was no fixed proportion prescribed, but an order: blood, phlegm, black bile and yellow bile. In accordance with this order, the fluids should exist in declining amounts. The essential purpose and principle of a cure in Elizabethan England is the restoration of the person's normal distribution of the humors. Here are some of the cures commonly recommended at the time

Some Elizabethan Cures

Bloodletting - evacuates harmful humors from the veins
Purgation - also removes harmful humors
     Black hellebore - a favored purgative for melancholy
     Borage -- a purgative for melancholy
     Rhubarb - favored for choler
Heating - to counteract the coldness of melancholy
Moisture - to counteract the dryness of melancholy
Diet - warm and moist foods are recommended
Rest - idleness and sleep warm and moisten the body
Peace of mind - mental perturbation breeds ill humors
     Music - counteracts a heaviness of spirit
     Drama - counteracts a heaviness of spirit

Borage and Hellebor fill two sceanes,
Soveraigne plants to purge the veines,
Of melancholy, and cheare the heart,
Of those blacke fumes which make it smart.
To cleare the Braine of misty fogges,
Which dull our senses and Soule clogges.
The best medicines that ere God made
For this malady, if well essaid.
 - Robert Burton, The Anatomy of Melancholy (1632). Clarendon Press, Oxford. p.lxii.

Within Hamlet itself, there are a variety of cures that are suggested for Hamlet's melancholy. These are consistent with common Elizabethan thought on curing the illness. Here's a partial list.

consolatio philosophiae
You must know your father lost lost a father,
That father lost, lost his... I.ii.89.
unburdening the heart
You do surely bar the door upon your own liberty,
If you deny your griefs to your friend.  III.ii.345.
         so by your companies
To draw him on to pleasures" II.ii.14
the pleasure of the theater
        It doth much content me
To hear him so inclined.
Good gentlemen, give him further edge
And drive his purpose into these delights. III.i. 24-27.
travel and outdoor activity
Haply the seas, and countries different,
With variable objects, shall expel
This something-settled matter in his heart,
Whereon his brains still beating puts him thus
From fashion of himself."   III.i.174-178.