Spiral waves in cardiac tissue have been identified as a significant factor leading to life-threatening arrhythmias and ventricular fibrillation. Consequently, understanding the mechanisms underlying the dynamics of such waves and exploring strategies for their elimination have garnered substantial interest and emerged as crucial research objectives. Spiral waves often become pinned (trapped) at anatomical obstacles in cardiac tissue, resulting in increased stability and posing challenges for their elimination. The unpinning of spiral waves can be achieved through the application of an external electric field and has been the subject of previous research. Recently, optogenetics has emerged as an alternative method to modulate electrical activity by illumination of cardiac tissue. In this paper, we employ mathematical modeling to investigate the potential of utilizing local illumination to unpin and eliminate spiral waves in cardiac tissue. We also extend this methodology to explore the effects of more complex turbulent excitation patterns. We conduct simulations using low-dimensional (Barkley) and ionic (Fenton-Karma) models of cardiac tissue, incorporating optogenetical channels. Our findings demonstrate that local suprathreshold illumination can successfully unpin spiral waves in 100% of cases. Notably, unlike unpinning by electrical field stimulation, this approach does not necessitate precise timing of stimulus application during a specific phase of rotation. Additionally, we demonstrate that periodic optogenetical stimulation can effectively eliminate both unpinned spiral waves and turbulence by moving them toward the boundary via an antitachycardia pacing mechanism.