The best way to prevent herpes is to have safe sex with your partner in a monogamous relationship. But make sure that both of you are freee with genital herpes. You and your partner should have conversation and get tested for engaging with sex. Although herpes can't be accurately diagnosed without symptoms, you can ask your doctor to have blood tests to detect the HSV antibodies
It's gonna sound super plain but when having sex you're always taking a risk, using condoms is a good prevention but not 100% use latex not any thing like lamb skin. Asking your partners is a good idea but they need to know there status, and just because they don't think they don't have anything doesn't mean they don't. The only 100% way is honestly not having sex. Just make sure you know your status by getting tested.