There's no single instrument called a "whip," but several create whip-crack or swishing effects:
A flat wooden slat on a long cord. Swung in a circle, it produces a low, resonant humming/roaring used in Indigenous Australian, African, and Native American ceremonies.
Sound-effect devices or software plugins synthesizing the sharp crack of a bullwhip for film, theater, and music production.
Two hinged wooden boards struck together to mimic a whip crack. Used in orchestral music (e.g., Strauss's Till Eulenspiegel) and comedy.
A metal tongue bent by a wooden knob, producing a glissando "wobble" sometimes used for cartoonish whip effects.
Traditional whip-cracking (actual bullwhips) is a performance art, but the whip itself is a tool, not a musical instrument per se.