You can try to prevent cold sores but there is no guarantee that you won't get a cold sore.
To try and avoid getting a cold sore, never share anything that might touch ones mouth such as utensils, toothbrushes lip products or drinks.
Of course you can share the utensils if they're washed before another person uses it but don't share the same utensils when someone has been eating with it right that moment.
Also be sure to wash your hands and face frequently and keep your immune system boosted up by getting plenty of Vitamin C and other Vitamins.