I came across a situation where I went to a volunteer class wearing a mask since I have a cough. My sensei told me "お大事に", and I did not know what to reply.
In this case, should I just say "はい"? Or is there a more appropriate response?
The most common reply among us native speakers would be a simple 「ありがとうございます。」.
「はい」 would sound pretty strange. You could say 「はい、ありがとうございます。」, though.