How to demuxing a video stream?

When speaking of video formats, demuxing or demultiplexing basically means splitting the file that contains both audio and video data (and possible other data streams as well, like subtitles), into separate files, each containing one element of the original file.  Opposite of demux is muxing, which basically joins the datastreams back together.