We are given that \( \sin \theta = \cos \theta \) and \( 0^\circ \leq \theta \leq 90^\circ \).
Step 1: Use the identity for sine and cosine.
We know that:
\[
\sin \theta = \cos \theta
\]
This occurs when \( \theta = 45^\circ \), as at \( 45^\circ \), both \( \sin 45^\circ \) and \( \cos 45^\circ \) have the same value:
\[
\sin 45^\circ = \cos 45^\circ = \frac{\sqrt{2}}{2}
\]
Step 2: Conclusion.
Therefore, the value of \( \theta \) is 45°. The correct answer is (B).