Heuristic is the art and science of discovery. The word comes from the same Greek root as "Eureka!". It means "to find" or "pertaining to finding". You might also define it as the study of search.
A heuristic is a particular method of directing your attention to find something. A classic example of a heuristic is Hill-Climbing.....
As an adjective, heuristic means "pertaining to or aimed at discovery or steering your attention in a fruitful direction, as opposed to making an evaluation or final judgement." For example, it's a heuristic move to spend a couple hours tinkering with some unfamiliar computer source code before making an estimate about how much time it will take to add a certain new feature. See Deferred Judgement.
Logic is traditionally defined as the art and science of reasoning. Principal topics in logic include: what propositions are, what concepts are, and what relationships between propositions that need to exist in order for one proposition to validly serve as the basis for inferring another.
Heuristic is about how to steer your attention so that you find things that meet the criteria of logic. For example, how might you come up with a proposition that solves a certain problem? For example, if you are shown a geometry problem and are asked to find a formula to express the length of one line in it in terms of the lengths of other lines in the same diagram, heuristic would include the methods that you use to search for that formula. Logic would include the relationship between the formula and the other lines, and whether the proof for your answer really establishes that it's right. At the border between the two topics is how the formulation of the problem implicitly defines the search space.
Principal topics in heuristic include: what search spaces are, methods of navigating a search space (that is, heuristics), and the assumptions that a given heuristic makes about its search space.
Heuristic relates to nearly every subject of human interest, because nearly everything that's interesting in the world is, in some way or other, a needle in a haystack. For any man-made object of interest, just ask, "How did someone come up with that?" For example, how did anyone figure out how to make bread? If you look at wheat growing in the wild, it doesn't exactly come with instructions. Another example: how did people first hit on the idea of the alphabet? Jared Diamond reports that people only independently hit on that idea a few times in human history.
See Kubla Khan for an example of heuristic as describing the most puzzling aspect of many extraordinary human artifacts.
Heuristic even goes beyond man-made objects. Human DNA, for example, is a needle in a truly enormous haystack: the set of all possible genetic codes. How did nature find that, given the vastness of the set of possible DNA sequences and the fact that almost none of them code for viable organisms?