Calculators either use the Taylor Series for $\sin / \cos$ or the CORDIC algorithm. A lot of information is available on Taylor Series, so I'll explain CORDIC instead.
The input required is a number in radians $\theta$, which is between $-\pi / 2$ and $\pi / 2$ (from this, we can get all of the other angles).
First, we must create a table of $\arctan 2^{-k}$ for $k=0,1,2,\ldots, N-1$. This is usually precomputed using the Taylor Series and then included with the calculator. Let $t_i = \arctan 2^{-i}$.
Consider the point in the plane $(1, 0)$. Draw the unit circle. Now if we can somehow get the point to make an angle $\theta$ with the $x$-axis, then the $x$ coordinate is the $\cos \theta$ and the $y$-coordinate is the $\sin \theta$.
Now we need to somehow get the point to have angle $\theta$. Let's do that now.
Consider three sequences $\{ x_i, y_i, z_i \}$. $z_i$ will tell us which way to rotate the point (counter-clockwise or clockwise). $x_i$ and $y_i$ are the coordinates of the point after the $i$th rotation.
Let $z_0 = \theta$, $x_0 = 1/A_{40} \approx 0.607252935008881 $, $y_0 = 0$. $A_{40}$ is a constant, and we use $40$ because we have $40$ iterations, which will give us $10$ decimal digits of accuracy. This constant is also precomputed1.
Now let:
$$ z_{i+1} = z_i - d_i t_i $$
$$ x_{i+1} = x_i - y_i d_i 2^{-i} $$
$$ y_i = y_i + x_i d_i 2^{-i} $$
$$ d_i = \text{1 if } z_i \ge 0 \text{ and -1 otherwise}$$
From this, it can be shown that $x_N$ and $y_N$ eventually become $\cos \theta$ and $\sin \theta$, respectively.
1: $A_N = \displaystyle\prod_{i=0}^{N-1} \sqrt{1+2^{-2i}}$
The law of cosines applied to right triangles is the Pythagorean theorem, since the cosine of a right angle is $0$.
$$
a^2 + b^2 - \underbrace{2ab\cos C}_{\begin{smallmatrix} \text{This is $0$} \\[3pt] \text{if } C\,=\,90^\circ. \end{smallmatrix}} = c^2.
$$
Of course, you can also apply the law of cosines to either of the other two angles.
$$\text{sine}=\frac{\text{opposite}}{\text{hypotenuse}};\text{ therefore }\frac{\text{opposite}}{\text{sine}} =\frac{\text{hypotenuse}}{1} = \frac{\text{hypotenuse}}{\sin90^\circ}.$$
Therefore, the law of sines applied to right triangles is valid.
Best Answer
Consider you have triangle as below. $A, B, C$ are its vertices, $a, b, c$ are its sides, $\alpha, \beta, \gamma$ are its angles (I haven't marked $\beta$ and $\gamma$, so let's describe all we need for $\alpha$).
$\alpha$ is an acute angle of right triangle $ABC$. Side $BC$ (or $a$, which is name given to it using other notation) is its opposite cathetus, while $AC$ (or $b$) is its adjacent cathetus. $AB$ (or $c$) is a hypothenuse.
Considering this, for example $\sin \alpha = \frac{\text{opposite}}{\text{hypothenuse}} = \frac{BC}{AB} = \frac ac$. It's very similar for other functions, hope you're able to manage with them.
As @abel correctly mentioned, trigonometrical functions are defined not for a triangle but for an angle, so you need to check that the triangle is right, find a given acute angle in it and then you will have two sides adjacent to this angle (hypothenuse and adjacent cathetus) and one side opposite to it.