The one thing you need to hear I think (or at least what I would have wanted to hear) is that everything is going to be okay.
Those really upsetting moments when you didn’t do as well as you think you could have? Walk away. It’s done. It is what it is. Focus on what you have to do in the future. You can mourn for those moments on break, with a good movie and as much chocolate as you want.
Ask the teacher what they want. Don’t assume you know. Verbalize. Start dialogues with your teacher. You could write a brilliant theorem that changes the nature of x, but that’s not going to get you the grade if all your teacher wanted was one page of personal thoughts on z.
You’re going to overwork yourself if you try to put the extra mile into every little assignment. Ask the teacher how much an assignment is worth. Don’t burn yourself out over an assignment that’s worth 10 points. Just do what is asked of you.
Learn how to be by yourself. This is hard, and this navigates the huge line between mental health and survival etc. but you will be okay if you don’t have a lot of friends. Especially for those who are in a new place. Don’t jump at new friends just because you’re lonely, you’re gonna burn out. Plus, most of the people you meet in undergrad you really won’t know past graduation.
Find the importance of each class you’re taking, even if it’s just “this helps me destress.” You’ll do a lot better if you have a reason to care about the class. “There are no boring subjects only disinterested minds.”
Let worrying about other people’s work compared to yours go. Seriously.
Remember that school may not even be for you in the long run, and it’s okay to do only exactly what is asked to get through if all you want is to get through just to have the degree. It’s okay for that to be your goal. There’s a lot going on in saying that with “hard work” culture, and “being the best” and job markets and such, but there are other things that can be done in life besides things requiring climbing higher education, and most of these things you learn in school can be learned by books. (There are exceptions of course, but this is dependent entirely on what you want to do.)
You won’t recognize just how much you’ve grown until much later, and undergrad feels like hell generally, but you’ll be okay. It will seem like a dream after you move on from it, a long and really strange dream.