Something like: "You can take it whenever you need to" might refer to almost anything. However, if it is said by a doctor to a patient, then the context is clear, and the listener can guess it refers to some kind of medication. So the context is what goes with a text (written or spoken) which helps the reader (or listener) understand the communication.