As with many things in trig, there is more than one way to approach this. I don't know your trig background so I'll be as basic as possible.
The unit circle approach
The unit circle is the circle with center $(0,0)$ and radius $1$. dreamer's comment to your original question contains a good picture. In terms of the unit circle, $\cos\theta$ and $\sin\theta$ are defined to be the $x$- and $y$-coordinate, respectively, of the point of intersection the (terminal side of the) angle $\theta$ makes with the unit circle. From the picture, you can see that an angle of $45^\circ$ hits the unit circle at the point $\left(\dfrac{\sqrt{2}}{2}, \dfrac{\sqrt{2}}{2}\right)$. So the cosine of $45^\circ$ is the $x$-coordinate of this point, and the sine of $45^\circ$ is the $y$-coordinate of this point. Similarly, we see from the picture that an angle of $135^\circ$ hits the unit circle at the point $\left(-\dfrac{\sqrt{2}}{2}, \dfrac{\sqrt{2}}{2}\right)$.
The trig identity approach
Here are two well-known trig identities:
\begin{align}
\cos(a-b) &= \cos a\cos b + \sin a \sin b\\
\sin(a-b) &= \sin a\cos b - \cos a \sin b
\end{align}
Let $a = 180^\circ$ in those identities (and let $b$ just represent any arbitrary angle) to get the desired results:
\begin{align}
\cos(180^\circ - b) &= \cos 180^\circ \cos b + \sin 180^\circ \sin b\\
&= (-1) \cdot \cos b + 0 \cdot \sin b\\
&= -\cos b\\
\sin(180^\circ - b) &= \sin 180^\circ \cos b - \cos 180^\circ \sin b\\
&= 0 \cdot \cos b - (-1) \cdot \sin b\\
&= \sin b
\end{align}
Here we've used the facts that $\cos 180^\circ = -1$ and $\sin 180^\circ = 0$. These can be easily obtained from the unit circle.
If any of this is over your head, don't worry about it. As you continue your studies in trig it will start to make sense and you'll start to see how a lot of these properties relate to each other.
Shameless self-plug: I do have a series of trig tutoring videos on YouTube if you want to learn more.