@simrin-- I'm glad you mentioned your occupation because I think carpal tunnel prevention, and treatments should be specifically based on the activity that's causing it.
Everyone can and should do the stretching exercises to prevent carpal tunnel. But there are some occupations that are at much greater risk for carpal tunnel. Pianists and other musicians, secretaries, medical personnel and body builders are at higher risk. They rely on their hands and often do movements that put pressure on their carpel tunnel over and over again.
So you have to figure out which movement is the cause of the pain and try to adjust your movements in a way that will decrease the pressure and damage. This might mean different techniques, using supportive equipment for your wrists and hands or simply remembering to stretch throughout the day to relax those muscles.