I think that the main reason why we do not understand the general principles of how knowledge works (and probably also the reason why we have not yet designed and built efficient machines capable of artificial intelligence), is not the excessive complexity of cognitive phenomena, but the lack of the conceptual and methodological tools to properly address the problem. It is like trying to build up Physics without the concept of number, or to understand the origin of species without including the mechanism of natural selection. In this paper I propose some new conceptual and methodological tools, which seem to offer a real opportunity to understand the logic of cognitive processes. I propose a new method to properly treat the concepts of structure and schema, and to perform on them operations of structural analysis. These operations allow to move straightforwardly from concrete to more abstract representations. With these tools I will suggest a definition for the concept of rule, of regularity and of emergent phenomena. From the analysis of some important aspects of the rules, I suggest to distinguish them in operational and associative rules. I propose that associative rules assume a dominant role in cognition. I also propose a definition for the concept of problem. At the end I will briefly illustrate a possible general model for cognitive systems.