The core principle of optogenetics involves the use of light-sensitive proteins called opsins. These proteins are introduced into specific cells using genetic engineering techniques. Once expressed in the target cells, the opsins can be activated or inhibited by specific wavelengths of light, allowing for precise control over cellular activity. Commonly used opsins include channelrhodopsin, which excites neurons when exposed to blue light, and halorhodopsin, which inhibits neurons when exposed to yellow light.