This thorough article from Wikipedia provides a comprehensive overview of the Havdalah ceremony that concludes Shabbat, including an introduction to the basic structure of the ritual, the meaning behind it, and variations depending on different customs and times in the Jewish calendar.
Havdalah
Havdalah (“separation”) is a Jewish religious ceremony that marks the symbolic end of Sabbath and Jewish holidays, and ushers in the new week. The ritual involves lighting a special havdalah candle with several wicks, blessing a cup of wine and smelling sweet spices. Shabbat ends on Saturday night after the appearance of three stars in the sky. Some communities delay the Havdalah in order to prolong Shabbat.
Customs
As for kiddush, havdalah is recited over a cup of kosher wine or grape juice, although other beverages may be used if wine or grape juice are not available.
Spices, called besamim in Hebrew, often stored in an artistically decorative spice container in order to beautify and honor the Mitzvah, are handed around so that everyone can smell the fragrance. In many Sephardi and Mizrahi communities, branches of aromatic plants are used for this purpose, while Ashkenazim have traditionally used cloves. A special braided Havdalah candle with more than one wick is lit, and a blessing is recited. If a special havdalah candle is not available, two candles can be used, and the two flames joined when reciting the blessing.
When reciting the words “Barukh atah Adonai Eloheinu melekh ha’olam, bo’re m’orei ha’esh,” it is customary for the participants to hold their hands up to the candle and gaze at the reflection of the light in their fingernails.
At the conclusion of Havdalah, the leftover wine is poured into a small dish and the candle is extinguished in it, as a sign that the candle was lit solely for the mitzvah of Havdalah. Based on Psalms 19:9, “the commandment of the Lord is clear, enlightening the eyes,” some Jews dip a finger into the leftover wine and touch their eyes or pockets with it. Because it was used for a mitzvah, the wine is considered a “segulah,” or good omen.
After the Havdalah ceremony, it is customary to sing “Eliyahu Hanavi” (“Elijah the Prophet“) and bless one another with the words “Shavua’ tov” (Hebrew) or “Gute vokh” (Yiddish) (Have a good week).
Havdalah is also recited at the conclusion of the following biblical holidays: Rosh Hashanah; Yom Kippur; the first days of Sukkot; Simchat Torah; Passover, both its first and last days; and Shavuot. The blessing over the wine is said, as well as the prayer separating the holy from the everyday, but not the prayers over the havdalah candle or the spices (except for the conclusion of Yom Kippur when the prayer over the havdalah candle is recited).
When a major holiday follows Shabbat, the Havdalah service is recited as part of the holiday kiddush and the blessing over spices is not said. The special braided Havdalah candle is not used since it may not be extinguished after the service, but rather the blessing is recited over the festival candles. The prayer “distinguishes holiness from the everyday” is changed to “distinguishes holiness from holiness” signifying that the holiness of the holiday is of a lesser degree than the holiness of the concluded Shabbat.
Significance
Havdalah is intended to require a person to use all five senses—to taste the wine, smell the spices, see the flame of the candle and feel its heat, and hear the blessings.
Following a normal Shabbat, the order of the prayers corresponds to the acrostic יבנ”ה “Yavneh”, with the initials Yayin (wine), Besamim (spices), Ner (candle), and Havdalah (the Havdalah prayer).
The order of elements when Havdala is combined with kiddush (e.g., on a Saturday night that is ‘Yom Tov’ (i.e., literally, ‘Good Day’) is known by the acrostic Yaknhaz. This is the initial letters of Yayin (wine), Kiddush HaYom (blessing the day), Ner (candle), Havdala (the Havdala blessing) and Zman (time, i.e. shehechiyanu).
Blessings
The central blessing of the Havdalah is the following paragraph, of which there are variants:
Blessed art thou, God, our Lord, King of the Universe
Who distinguishes
Holiness from the everyday,
Light from dark,
Israel from the nations,
The seventh day from the six workdays.
Blessed art thou, God,
Who distinguishes holiness from the everyday.
The text of the Havdalah service exists in two main forms, Ashkenazic and Sephardic. The introductory verses in the Ashkenazic version (beginning הנה אל, Hinei El) are taken from the biblical books of Isaiah, Psalms and Esther.
In the Sephardic liturgy, the introduction begins with the words ראשון לציון, Rishon L’tsion and consists of biblical verses describing God giving light and success interspersed with later liturgical prose.
The four blessings over the wine, spices candle and praising God for separation between holy and profane are virtually identical between the traditions. The phrase בין ישראל לעמים, bein Yisrael l’amim ‘between Israel and the nations’ is based on Leviticus 20:26. In Reconstructionist Judaism, however, the phrase is omitted, as part of founder Mordechai Kaplan’s rejection of the Biblical idea of chosenness.