how do u get herpes

so i was googling lots of stuff earlier. the question i kept typing it had no answer so i figured i would come here. Can you ONLY get herpes if one person was cheating in the relationship?