Guilds were corporations of artisans, craftsmen, merchants, and other professionals that furthered the interests of their members. The origin of the guilds goes back to Roman times, when the state instituted standards for weights and measures and for the quality of work done by craftspeople.
In the eleventh and twelfth century, guilds formed in western Europe not as state-controlled groups, but as self-governing organisations. Their ostensible reason for forming was to ensure standards, but they also devoted much attention to restricting competition, particuarly from foreign sources.
Guild members tended to congregate in specific areas of the town (to create a market, to avail themselves of support services, and to keep an eye on one another), which made the guild responsible for civic life in their quarter or district The guilds were thus important in the development of independent town government during the Middle Ages.
The guilds established an apprentice system in which "masters" would train young people (usually from the family of members) in a trade in return for their free servitude. The guilds regulated quality, production and recruitment to the crafts in the interests of the employer and the established skilled man. The guilds provided for the sick, for members who had fallen into poverty, and for widows and orphans of guild members. Most guilds allowed women to become members as well as men, wives were often members of the same guild as their husbands because businesses tended to be family-run affairs in those days, and a widow would often carry on running the business after her husband died.
It was usual for guilds to profess the cult of a particular saint or saints, a convention which both reflected and promoted the association of saints with individual crafts or trades. Guilds would peform plays and pageants based on Biblical stories at particular times of year, like the Passion of Christ which would be enacted at Easter.
The role of the medieval guilds declined in the 16th century, but in England the liveried Companies evolved out the guilds and performed much of the same functions, regulating business practices, enforcing standards of workmanship and acting as benefit societies for their members, providing for widows and orphans and members who had fallen on hard times.
I don't think there is any exact equivalent of a guild in modern times, though trade unions fulfill some of the same functions. Hower, in medieval times there were far more independent craftsmen and tradesmen than there are nowadays, as today most people tend to work for large companies rather than being independent.
the middle Ages; A concise Encyclopedia
The Pimlico Encyclopedia of the Middle Ages
'medieval women' by Eileen Power
'Elizabethan England' by Alison Plowden