Enzymes are highly specific for the reaction they catalyze. Their structure allows them to highly specific as there are various enzyme theories that defines its selectivity.
One of them is Lock and Key model: In it a enzyme structure defines which substrate can fit into it enzyme is the lock and substrate is the key. So only a correctly size substrate can fit into the active site of enzyme.