When you take a square root, what are you doing? Square root "takes in" one number, and "spits out" another, but...what is it doing? Most folks know that numbers have square roots, and intuitively connect perfect squares with their square roots, but it's a lot foggier when you ask for the square root of 113. We could invoke a geometric analogy--"I would build a square that I knew whas 113 square units in area, then measure one of its sides"--but that's pretty obviously cumbersome and...how would you even measure the area without knowing the side length?
What you're asking for, in a formal sense, is "What IS a function? How does it WORK? Why would I ever consider connecting these things?" Trying to avoid excessive jargon and over-explanation (which my first attempt did TONS of), a function in logical terms is a relationship between two sets of things, an input set (formally called the "domain") and an output set (formally, "codomain"). The definition of "a function" is that it assigns, to every single thing in the input set, one
and only one thing in the output set. It's okay for two inputs to give the same output, but it is NOT okay for one input to give two outputs. You are, most likely, familiar with the "vertical line test": this is a graphical way of representing "does every input give only one output?" If a vertical line touches a plot more than once, then that means the value for that vertical line (some input x) is associated with more than one result (multiple y outputs).
It's easy to make functions with finite input sets. For example, I have four people in my immediate family counting myself, and each one of them has exactly one birthday. That means I could make a list, e.g. (fictitious values of course) "Father = November 1," "Mother = January 7," "Sister = July 4," "Self = August 19." This would be a function which takes "member of Ezekiel's family" as inputs, and gives "day of the year" as outputs. Since it's not physically possible for a person to have been born on more than one day of the year, we can be confident that this is an actual function. (Note that, if I had a
twin, then both "Self = August 19" and "Twin = August 19" would be true--but that's perfectly fine.)
It's harder to make such clean connections when the input set is infinitely large, like "positive whole numbers" or "all real numbers" etc. We can't make a complete list of
every number and its square, because that list would be infinitely long. Instead, we either make a table that is
good enough for what we need, or we figure out a procedure to calculate it. Trig functions are in this category. You can "look up" the associated value for any input angle, and you'll get some output that is between -1 and 1.
As for the physical
thing you're doing, well, looping back to the "what are you
doing when you take a square root?" example, you're relating the length of horizontal or vertical distances to going a certain amount of angle around a unit circle. I have made an image to assist:
For each and every value θ (a traditional variable for angle) you choose, there is one
and only one value for how far up (or down) you have to go in order to hit the unit circle along a line with that angle. That is what sin(θ) tells you. Likewise, there is one and only one value for how far left or right you'll go. In formal terms, cosine is the "projection" of that blue line onto the horizontal, while sine is the projection onto the vertical. Unlike with the triangle-bits version, though, you can have an angle that goes beyond 90 degrees, indeed, you can use
any angle you want, it just means going around the circle that many times before you stop and measure how far up/down and right/left you are.
But most people, just like with the "how do you find a square root," don't think overmuch about physically plotting a unit circle and measuring distances. They instead treat it as though "sin(θ)" and "cos(θ)" were
machines, where you can feed them the input number (in this case, the angle), and the machine (usually an actual machine, a calculator) will report the associated vertical distance or horizontal distance without you having to do a whole bunch of drawing and careful measurement to find out. These pairs of numbers--θ and sin(θ), for example--are associated with one another (in some sense) "because of" the properties of the unit circle, just as numbers are associated with one another (in some sense) "because of" the properties of square geometry.