Magic circle

A magic circle is a circle of space marked out by practitioners of some branches of ritual magic, which they generally believe will contain energy and form a sacred space, or will provide them a form of magical protection, or both. It may be marked physically, drawn in a material like salt, flour, or chalk, or merely visualised.
Techniques.
Traditionally, circles are believed by ritual magicians to form a protective barrier between themselves and what they summon. One text known as the Heptameron says of the circle, 'But because the greatest power is attributed to the circles; (for they are certain fortresses to defend the operators safe from the evil spirits); in the first place we will treat concerning the composition of a circle.'
Moreover, as magician and historian Jake Stratton-Kent writes, 'In short a circle is not an obsolete symbol of a superstitious fear of spirits, but an intentionally created ritual space for various purposes. It is not always required for all kinds of ritual work, but neither is it of no value, quite the contrary. Making sacred space is among the most primal of rituals, such intentional actions are as worthy of the term psychoactive as any substance.'
Circles may or may not be physically marked out on the ground, and a variety of elaborate patterns for circle markings can be found in grimoires and magical manuals, often involving angelic and divine names. Such markings, or a simple unadorned circle, may be drawn in chalk or salt, or indicated by other means such as with a cord. Some traditions include tracing or circumambulation.
Uses.
In Sumer.
The Sumerians called the practice of using ritual circles "zisurrû".
In Judaism.
Examples of Jewish customs showing the use of the magic circle can be found in the birth protection rituals of Alsace and the surrounding area. As early as 1560, a text by the rabbi Naphtali Hirsch ben Elieser Treves notes a custom in which a circle is drawn around the birthing woman to protect her from Lilith and demons. This was done using a Krasmesser (circle knife) which would be wielded by the midwife or the father of the child. Paul Christian Kirchner’s description of Jewish birthing customs from 1734 includes an illustration showing a knife or a sword near the bed, and likewise Johann Christian Georg Bodenschatz describes a sword placed near the pregnant woman in the eighteenth century, indicating the likelihood that this custom continued through the centuries. Oral accounts from 20th century Baden-Württemberg in a publication by the Jewish Museum of Switzerland also reference circling movements with a knife in order to protect a woman in childbirth. 
In the Golden Dawn.
The Hermetic Order of the Golden Dawn, which has had one of the largest influences on contemporary Western esotericism, introduced the practices of the Lesser Ritual of the Pentagram and the Opening by Watchtower. The Lesser Banishing Ritual of the Pentagram (LBRP) is typically used as a daily practice and is also performed before any magical working, while the Watchtower ritual is much more involved. Both rituals are now used by a wide array of practitioners, including ceremonial magicians, Hermetic Qabalists, Neopagans, and Thelemites.
In Wicca.
In Wicca, as also in traditional European grimoires, a magic circle is typically nine feet in diameter, though the size can vary depending on the purpose of the circle, and the preference of the caster. 
Some varieties of Wicca use the common ceremonial colour attributions for 'quarter candles': yellow for air in the east, red for fire in the south, blue for water in the west and green for earth in the north (though these attributions differ according to geographical location and individual philosophy).
The common technique for raising energy within the circle is by means of a cone of power.
The barrier is believed to be fragile, so that leaving or passing through the circle would weaken or dispel it. This is referred to as "breaking the circle". It is generally advised that practitioners do not leave the circle unless absolutely necessary.
In order to leave a circle and keep it intact, Wiccans believe a door must be cut in the energy of the circle, normally on the east side. Whatever was used to cast the circle is used to cut the doorway, such as a sword, staff or knife (athame), a doorway is cut in the circle, at which point anything may pass through without harming the circle. This opening must be closed afterwards by reconnecting the lines of the circle.
The circle is usually closed by the practitioner after they have finished by drawing in the energy with the athame or whatever was used to make the circle including their hand (usually in a widdershins: that is, counter-clockwise fashion). This is called 'closing the circle' or 'releasing the circle'.