How is soma used in the Brave New world?

Soma is used as a comfort mechanism when dealing with stress. A user is able to self-medicate themselves whenever confronted with something unpleasant or uncomfortable. Through soma, the need for religion and other personal allegiances outside of the World State are no longer needed.