how to do math

Well, alaina, this is a very general question, and people spend whole careers on such questions.

At a fundamental level, Algebra is the study of variables - unknown quantities that we would like to solve for.

Here's an example: If you have a certain number of apples, and a friend of yours has 5 more apples than you do, and you two have 15 apples altogether, how many do you have, and how many does your friend have? We represent the unknown quantity "how many do you have" as a variable, x. Since your friend has 5 more than you do, she has x+5. Then, since you have 15 between you, we can say:

x + (x+5) = 15.

The two x's combine:

2x + 5 = 15

Then we subtract 5 from both sides:

2x = 10

and then divide both sides by 2:

x = 5.

Therefore, you have 5 apples, your friend has 10 apples (5 more than what you have) and between you, you have 15 apples, as required by the question.