In many places in Shulchan Aruch it mentions times when "Tzedok HaDin" is said or not said. What is this *exactly* and when was it said at which occasions, etc.
Answer:
Tziduk Ha-Din is a paragraph which is said upon a person's passing (see Yoreh De'ah 339). It is commonly recited today at the burial.
You can find the Ashkenaz version of tziduk ha-din here.
The Shulchan Aruch discusses saying tziduk ha-din during a mo'ed, during days of Chanukah, on Rosh Chodesh, and so on.
The Rema writes in a number of places that it is not said on any day on which Tachanun is omitted.