Most spells and rituals are performed within a cast circle. There are several reasons why this is a good idea.
It creates a neutral environment where the desired types of energies can blend and work
It keeps out all unwanted energy that can affect a working.
It contains any energy raised until you are ready to release it.
It helps you focus on what you are doing by creating a boundary between everyday life and ritual.

A circle is usually cast before a ritual is begun and taken down after it is finished. The boundary of the circle is not crossed until it is taken down, after the ritual. It is my opinion that the boundaries of a cast circle should never be crossed unless it is an absolute emergency. A cast circle is a wall of energy, a boundary between the physical world and the spiritual. Imagine a spiderweb formed in a circle around an area. If you walk through it, you are going to break it, so it's no longer a boundary. It's the same with a circle of energy. Crossing over it will break the boundary, and you will no longer have a neutral environment for the ritual. Most of the time, there is no need to cross over the boundaries. Just make sure you have everything you need for the ritual before you begin. I'm not perfect, and I have forgotten things a few times myself, but when this happens, I take down the circle and start over.

This is a basic outline of a circle casting. There are many different ways to cast a circle, this is just a basic example.

The boundary of the circle is drawn with a tool, such as the athame, sword or wand, depending on the tradition or type of working. The circle itself is visualized. It is usually drawn in a clockwise direction. Some people move counterclockwise for dark moon rituals, rituals honoring dark moon deities or decreasing workings.

The circle is consecrated with the four elements, an example would b incense for air, a candle for fire, water, and some salt or a bit of soil for earth.

The quarters are called and a candle is lit in the appropriate direction to represent each. The starting point for this depends on the tradition or personal preference. Some people start in the east with air, some in the north with fire.

The ritual is then performed.

After the ritual, the circle is taken down by thanking and dismissing the quarters and cutting the circle by using a reverse motion of the same tool with which it was cast. This releasing any remaining traces of energy.

Again, this is only one of the many ways to cast a circle. There are more elaborate ways of doing it, and there are simple ways of doing it. For a simple prayer or meditation, visualizing a circle of protective light around yourself and your working area may be sufficient.