If we understand how proteins work, then we should be able to design proteins that work. While the design of proteins that fold to desired structures is a mature field, the design of proteins that perform desired functions has met with limited success. Most proteins function by first binding a substrate or cofactor, often with exquisite selectivity. Thus, to advance and test our understanding of protein function, we must first understand how proteins recognize small molecules. In this talk, I will discuss my approach toward understanding molecular recognition through the design of small-molecule–binding proteins from scratch. By analyzing thousands of protein structures in the Protein Data Bank, I discovered a structural “code” used by proteins to preferentially bind the chemical groups commonly found in small molecules. I developed a design algorithm called COMBS that uses this code to create ligand-binding proteins from scratch; and I demonstrated its utility by the design of a de novo protein that specifically binds the antithrombotic drug, apixaban. This work sets the stage for the design of custom ligand-binding proteins as antidotes, drug carriers, allosteric switches, and catalysts, as well as a new route to the discovery of protein-binding ligands.