Thinking ahead is often needed to make a solution that is easy to use and understand. It involves:
Before devising a solution to a problem, you'll need to know the format of the information your program is recieving, and the format it should give back. What data type is the input? What about the output? Should either be sorted (if they're lists)?
These are details about your input that must be true, or else the algorithm can break, e.g. binary search requires that the list is pre-sorted.
This is performed by the operating system; frequently used data and instructions are stored for later use, so they can be quickly accessed, to save time.
In programming, thinking ahead is key to making programs easily re-usable, which saves the time spent testing and debugging subroutines and modules.