Several researchers have highlighted the importance of studying stress and exploring methods to effectively reduce its harmful effects on human wellbeing. Biofeedback is an emerging technology being used as a legitimate preventive health care technique for achieving higher levels of well-being and can also be used for stress management. In this paper, we propose a mathematical model for personalizing relaxation techniques for stress management. The model considers both physiological reactions to various relaxation techniques and contextual information to optimize relaxation effectiveness. The long term objective is to teach users about what actually works best for them among several relaxation techniques. A case study for ubiquitous stress management application is presented to demonstrate the effectiveness of the model. The simulation results demonstrate the ability of the proposed model to provide users with feedback about what relaxation techniques work best for them as well as adapt to various environmental conditions.