Knowing what was used to encode it can go a long way, and having some idea of what it says won't hurt. Newspapers often have "Cryptograms" that are made from a simple substitution cipher. It will have many characters so it's unlikely that the wrong substitutions will make a coherent message and they'll sometimes make the encoded message the answer to a riddle so the message is meaningful. These are meant to be broken of course, but are examples of how not to use a substitution cipher if you want security.
Just knowing the method can do the trick as well. Any RSA encryption can be broken given enough time, though done properly it's an extremely long time (ideally long after the data is no longer sensitive).
Using the same code over and over can do you in. Say a baseball coach has 5 different signals to mean "steal second". Over the course of one game, he can use these without trouble. If he used the same set of signals to mean "steal second" for an entire season, people will catch on (if they're paying attention).
It really depends on the method used, and also how it's used as to just how secure your encryption is, as well as the resources and ability of your attackers.