The surging growth of the pharmaceutical industry is a result of the rapidly increasing human population, which has inevitably led to new biomedical and environmental issues. Aside from the quality control of pharmaceutical production and drug delivery, there is an urgent need for precise, sensitive, portable, and cost-effective technologies to track patient overdosing and to monitor ambient water sources and wastewater for pharmaceutical pollutants. The development of advanced nanomaterial-based electrochemical sensors for the detection of pharmaceutical compounds has garnered immense attention due to their advantages, such as high sensitivity and selectivity, real-time monitoring, and ease of use. Recently, my research team has designed and fabricated a variety of functional nanomaterials and nanocomposites. In this talk, the synthesis of nanoporous gold and the development of graphene-based nanomaterials as well as their promising applications in electrochemical sensing of different pharmaceutical compounds (e.g., acetaminophen, naproxen and isoniazid) are presented. The design rationale and the performance of the proposed electrochemical sensors are highlighted.