What happens when enzymes are not in their optimal pH

What happens when enzymes are not in their optimal pH (hint: link to protein structure)? How does this affect
enzyme activity?