How does a calculator determine $\sin(x)$?
The opposite side and the hypotenuse define a ratio between them, and similar right triangles will have the same ratios of opposite to hypotenuse for a marked angle, thus the same sine of that angle. In this way, the sine depends on only the angle; any requirement of knowing the lengths of the sides is removed.
A calculator therefore approaches the sine in some way that does not require constructing any right triangle – even one of hypotenuse 1 with the required angle. The most common method is through its Taylor series, where some values may be cached for lookup and interpolation if efficiency is critical. In the past, other methods like CORDIC were used, but those have now fallen out of favour.
One marvelous idea you'll no doubt encounter later on in your studies of math is that of a series approximation.
Long story short, a series approximation is a way of representing a more complicated function, like $f(x)=\sin(x)$, as an infinitely long polynomial. What your calculator is doing when you try to calculate the sine of an angle is taking the first few (loosely speaking) terms of that series and just approximating the value you're looking for. But since it's a calculator, it can approximate the value you're looking for very, very well.
For example, the first few terms of the Taylor series (one particular kind of series approximation) of $\sin(x)$ are: $$\sin(x)=x-\frac{x^3}{3\cdot2\cdot1}+\frac{x^5}{5\cdot4\cdot3\cdot2\cdot1}$$ Your calculator knows more terms than that, but it's a good approximation of the approximation. Let's say you wanted to calculate the value of $\sin(\pi/2)$ (have you learned about radians yet?). The exact value is $1$, but that very rough approximation I gave would return $1.0045$, which is already pretty close to the exact value.