Your question is actually quite vague and as it stands applies to different syntactic situations: A comma precedes a non-restrictive (non-defining) subordinate clause. A colon precedes a clause, phrase or word that defines, clarifies or exemplifies the statement before the colon.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.