Does it help to pray right before surgery or is that negative thinking?

Sure. Anything positive prior to a challenging event is helpful. Positive prayers, positive thoughts, positive people to support you; all would be helpful. Pleasant thoughts, dreams, and prayers would all be beneficial.