Metamaterials emerged in the early years of the 21st century as artificial materials with unusual parameters, presenting an exotic electromagnetic behavior, with more possibilities for the control of electromagnetic radiation. Since their first experimental realization, the research in the field of electromagnetism had a great momentum and, as a result, numerous designs based on metasurfaces (the planar version of metamaterials) have been proposed for various applications such as telecommunications, security, spectroscopy, imaging, or sensing, among others. This Thesis investigates the use of devices inspired by the metasurfaces paradigm for sensing applications, operating in the terahertz frequency regime. The content of the Thesis can be divided into three distinct parts that are related to the different studies carried out in these years. First, the numerical and experimental design of metasensors for thin films, biological and chemical samples sensing applications. For this purpose, two types of metasurface-based structures are presented: a design with a complicated geometry that allows obtaining results with high sensitivity, and a design based on hole arrays that exploits the phenomenon of extraordinary transmission. On the other hand, the effect of geometry on metasensor patterns and its influence on detection quality is investigated by geometrical modification of a very simple tripod-based design. Finally, the application of mid-infrared spectroscopy for the analysis of oxidative products in animal meat is investigated.