'Fish out of water' is an analogy that is used to describe that someone, or something is out of its usual place or habitat and not fairing too well.
For example, someone might say that you are a 'fish out of water' if you are a car mechanic and you had to perform neurosurgery in order to save the world.

It probably originated as a metaphor in a play or a book years ago and became a well known phrase. Otherwise it came about through a swimming pool game known as 'Marco Polo'. The 'fish out of water' rule is a mutator to the game allowing the person who is 'it' to call 'fish out of water' when someone is out of the water to pass on the 'it' status.

You know that you are a 'fish out of water' if you find yourself in a situation that is rather uncomfortable and you find yourself gasping for air. And you know that you need to get yourself out of there fast!