Specifically, pickled vegetables need to be made with vinegar that has 5% acidity to prevent spoilage. Unfortunately, lower-acid white vinegar is more common in grocery stores.
Look for white distilled vinegar that's explicitly labeled as 5% acid. There are many bottles in-store that are only 4%, which can lead to bacterial growth and health risks.
According to Clemson University, the goal is a pH of 4.6 or lower. Anything less acidic allows Clostridium botulinum to grow, even if the jar is boiled at 212 degrees Fahrenheit.
It's easy to get the proper pH in a jar of pickles using distilled white vinegar with 5% acidity. You can also get some pH test strips or a pH meter to ensure everything is safe.
If you've made pickles with lower-acid vinegar that have been unrefrigerated for over 24 hours, throw them away. You can still refrigerate them if they're less than a day old.