Using L-Hospital's rue we compute the derivative of the numerator and the denominator
d(cosx)dx=−sinx
d(π2−x)dx=−1
Assemble the new expression and evaluate at the limit:
limx→π2−sinx−1=1
According to the rule the original limit goes to the same value
limx→π2cosxπ2−x=1