Here's how you could do that.
The idea here is that you need to figure out what can be added to the sample of contaminated water in order to cause the cadmium(II) cations,
In other words, you need to deliver to the sample an anion that would form an insoluble solid when paired up with the cadmium(II) cations.
Now, if you're dealing with distilled water, i.e. if the cadmium cations are the only ones present, you can precipitate them by adding a solution of sodium sulfide,
Sodium sulfide is a soluble ionic compound that dissociates completely in aqueous solution to form sodium cations,
The sulfide anions will precipitate the cadmium(II) cations by forming cadmium sulfide ,
#overbrace("Cd"_text((aq])^(2+))^(color(purple)("present in the sample")) + overbrace("S"_text((aq])^(2-))^(color(blue)("delivered by Na"_2"S")) -> "CdS"_text((s])# #darr#
Alternatively, you can also precipitate the cadmium(II) cations by reacting them with aqueous hydrogen sulfide,
#"H"_2"S"_text((g]) -> "H"_2"S"_text((aq])#
The reaction would look like this
#"Cd"_text((aq])^(2+) + "H"_2"S"_text((aq]) -> "CdS"_text((s]) darr + 2"H"_text((aq])^(+)#
Now, hydrogen sulfide is very dangerous because it is extremely toxic, so it's always a good idea to avoid using it altogether.
A safe source for aqueous hydrogen sulfide is thiocetamide,
For example, you can dissolve thiocetamide in a solution of ammonia to get
#"CH"_3"CSNH"_text(2(aq]) + 2"H"_2"O"_text((l]) + 3"NH"_text(3(aq]) -> 3"NH"_text(4(aq])^(+) + "CH"_3"COO"_text((aq])^(-) + "S"_text((aq])^(2-)#
The underlying reaction is basically the same, since the cadmium(II) cations will still be precipitated by the sulfide anions. The reaction will once again result in the formation of the yellow cadmium sulfide precipitate.