This is a great question! It is impossible to write down every word your teacher says, and it isn't necessary, either. But there are some strategies you can use to get down what is important, no matter what the class is. There are also good strategies for specific kinds of classes.
First, if you read in advance what the class is going to cover and create an informal outline in your notebook, you know in advance what is important in the reading materials, and when the teacher discusses those topics, all you have to do is fill in the notes in those sections.
Second, whatever the teacher writes down on the board is important and should be written in your notes.
Third, teachers have a way of repeating important points or raising their voices a bit when they come to important points. Once you get to know a teacher a little better, you will see that there are always these little clues.
Fourth, some teachers provide handouts that allow you to see what is important during their lectures. However, you should still take notes on the areas covered by the handout because this is another way knowledge gets into your brain, through your fingertips.
In any course in which there are definitions you must learn, always take notes on definitions. That is the vocabulary of the class, and you cannot learn without understanding that vocabulary.
In math classes, the examples written on the board should always be copied into your notes, along with what the teacher has to say about doing the example problem. You may think you understand the problem and how to solve it, but sometimes this knowledge slips away later on, when you have to do that kind of problem yourself. Formulas and what the teacher has to say about them should be part of your notes, too.
Good note-taking is a valuable skill in high school, in college, and even at work. It's wonderful that you are asking about this now, so you can begin to hone your skill.