plug in x=0 gives 0/0. This is one of the indeterminate forms (some others are ∞/∞ and 0·∞) use L'Hospital's Rule.
Differentiate the top and bottom of the fraction:
lim (cos x) / (x - π/2) => lim (-sin x) / (1 - 0)
Now you can substitute x = π/2 without problem
lim = -1/1= -1