The custom of spilling liquid from one’s cup prior to drinking:
There are many matters which the sages prohibited due to them containing danger of life, and whoever transgresses them and says I will endanger myself and it’s none of anyone else’s business, or says that I [do not worry of the chance of danger and] choose not to be careful about this, is liable to receive lashes known as Makas Mardus. This includes the following matter:
The letter of the law: One who drinks [water that was drawn from a river] even during the daytime, is required to pour out some of the water prior to drinking. He is to pour the water out prior to saying the blessing. [He is to pour out the water himself rather than have another person pour it for him. Likewise, one is to only pour a slight amount, and is to pour it with the back of one’s hand. Some Poskim rule that he to pour out the water three times, and that it is to be spilled specifically onto the ground. Some Poskim rule that he is to pour the water from the cup also after drinking from it. The implication in the Poskim is that this adherence only applies to water, and not to any other beverage.]
The worldly custom: Practically, the custom today is to no longer be careful in the above matter at all. One may even initially rely on this custom even if he is G-d fearing and a Torah scholar, and is generally particular regarding such matters. Nonetheless, some are accustomed to follow the above even today. Those who do so, are to do so inconspicuously, without gaining much attention to their stringency.
The Chabad custom: The Rebbe Rayatz was accustomed to pour water from the cup [even] prior to Mayim Achronim. The Rebbe was likewise witnessed by Chassidic gatherings to pour water from his cup of water or seltzer prior to drinking, however, not prior to drinking wine or other beverages. Some, however, claim that the above is a mere personal custom or stringency and was not followed by the Chassidim, and does not have the status of a Chabad custom meant for the public to undertake.
Pouring out water prior to giving someone else to drink from your cup: Irrelevant to the above discussion, one who drank water from a cup is to pour out some water from the side prior to offering another person to drink from it.
Some are accustomed to pour out water prior to drinking, prior to saying the blessing. Practically, the custom today is to no longer be careful in the above matter at all. Those who do so, are to do so inconspicuously, without gaining much attention to their stringency.
 See Hiskashrus 530-556 [Otzer Hachochma] p. 119; Koveitz Shaareiy Yeshiva Gedola 18:81; Migdal David 6 p. 536
 Admur C.M. Shemiras Haguf Vehanefesh 4; Michaber 427:9-10; Rambam Rotzeiach 11:5
 Admur C.M. Shemiras Haguf Vehanefesh 4; 206:5 “One who drinks water and spills out some of it prior to drinking due to worry of evil waters”; Story of Rav Papa in Chulin 105b and Rashi ibid; Tashbeitz 286; Sefer Chassidim 111; 852; Shaar Hamitzvos Parshas Eikev that it is proper to do so; Or Tzadikim 23:18 “One who drinks water is to spill some of it”; Shelah p. 80; Rashal in Yam Shel Shlomo Perek Kol Habasar 202; Elya Raba 171:24; Kaf Hachaim [Falagi] 24:40; Darkei Teshuvah 116:72; Kaf Hachaim 157:10; 170:82; See Hamelech Bemisibo Vol. 1 p. 269-270, 275-276; Omitted from Michaber, Rama, Tur, Rambam
 Rashal in Yam Shel Shlomo Perek Kol Habasar 202, brought in Kaf Hachaim 170:82; Tashbeitz ibid “Water that was brought from a river”; However, see Or Tzadikim ibid who implies to all waters, even if not drawn from a river.
 So write Admur and majority of Poskim ibid; However, see Arizal in Shaar Hamitzvos ibid that it is only p[roper to do so; Likewise, see wording in Admur 206:5 which implies that not all are accustomed to do so
 The reason: As there are evil waters, from which demons have drank from the river, and spilling it out is its healing. [Admur ibid; Chulin ibid and Rashi ibid] Alternatively, it is done in order so the reincarnated souls, and evil spirits, that may be found in the water do not cause one damage. [Or Tzadikim ibid; Rabbeinu Gershom on Chulin ibid]
 Admur 206:15; Sefer Chassidim 111; 852; Yifei Laleiv 3:116-17; Shaareiy Teshuvah 202; Kaf Hachaim 157:10; 170:82
The reason: It is not to be done after the blessing due to it being a belittlement of the blessing. [Admur ibid; Elya Raba 202:1]
 Tosafus Chulin 106a; Darkei Teshuvah 116:72
 Kaf Hachaim [Falagi] 24:40
 Kaf Hachaim [Falagi] 24:40 in name of Sefer Habris Vol. 1 Kesav Yosher Makor Chaim 8
 Hamelech Bemisibo Vol. 1 p. 270
 See Hiskashrus 530-556 [Otzer Hachochma] p. 119
 The reason: As when the public becomes accustomed to performing a danger, Chazal state “Shomer Pesaim Hashem.” [Shabbos 129b; See Tzemach Tzedek E.H. 11] Furthermore, when the danger is associated with matters of Segula [unnatural] then only when people beware from doing it does the Segula danger apply, while if people are no longer careful then the danger subsides completely. [Igros Kodesh 2:144] Alternatively, today the Ruach Raah no longer resides and only applies in Talmudic times, just as we rule regarding Zugos. [Rashal Yam Shel Shlomo Kol Habasar 12; See regarding garlic: Zivcheiy Tzedek 116:61; Kaf Hachaim Y.D. 116:92]
 Igros Kodesh 2:144
The reason: As when the danger is associated with matters of Segula [unnatural] then only when people beware from doing it does the Segula danger apply, while if people are no longer careful then the danger subsides completely. [Igros Kodesh 2/144]
 Darkei Chaim Veshalom p. 101; Custom of Rebbe and Rebbe Rayatz, brought below
 Kaf Hachaim [Falagi] 24:40
 Hamelech Bemisibo Vol. 1 p. 270
 Hiskashrus ibid
 Rav Eli Landa relates that his father did not do so, and that it was never considered specifically a Chabad custom to do so, and there were always some who did and others who did not, the latter being in the majority.
 Michaber 170:22; Tur 170:16; Tamid 27b; Tashbeitz 286; Hamelech Bemisibo Vol. 1 p. 269-270 that a) this is the correct thing to do [Reply of Rebbe to Rav Yaakov Katz, in opposition to Rav Zalman Duchman] and b) That this is a totally separate matter from the above. The practical ramification between the previous Halacha and this one is regarding if it is to be done even if no one else will be drinking from the cup.
 The reason: This is done to clean the come from any possible germs that the person being offered may be opposed to consuming.