You listen to class, you get bored, you look at your phone, check one email, go back to class, check Instagram go back to class. You are studying and you get bored and tired, so you check the phone again. All this phone checking and changing activities on the phone all the time is reducing your intellectual capacity.
To do maths you need a sharp mind and a sharp mind needs to be focused. If your mind jumps from one thing to the other, it loses energy and focus.
So, focus, focus, focus! Your mind cannot be in two places at the same time
Drop every useless thought, distraction or noise and just do what you have set yourself to do.
Focus solely on the activity at hand and, in particular, not letting other thoughts deviate you from the activity or the goal (thoughts like self-doubt or what would the other things or other type of thoughts). Be completely immerse in the activity, avoid being scattered mentally and activity-wise.
Your phone is a wonderful tool, so make sure that you use it and that "it" does not use "you".
Tips:
Do not look at the phone first thing when you wake up. So I recommend that you get an external alarm and that you do not use the phone as your wake-up alarm.
Do not look at a screen for at least half-an-hour before going to bed.
Switch-off your phone in class or when studying (or at least put it on "no-dot-disturb mode").
Try not to look at your phone between the short break between classes. This constant switch of activities drains your energy and concentration.
If you really want to spend time with your phone, allocate some time for it (the same you allocate time to study or doing sport) - before we did that with the TV: we allocated some time to make sure we were not overdoing it.
You can set up an automatic switch-off and switch-on of the phone for the night.
Your intellectual capacity is variable and it gets reduced with:
alcohol and other drugs;
a heavy stomach;
strong (negative) emotions like anger and anxiety;
not sleeping enough;
an unhealthy live-style (lack of physical exercise, smoking, lack of regular sleeping patterns,...);
a toxic or unhealthy environment (full of noise; not enough fresh air;...).
Be careful with coffee and energy drinks: in some cases they can create excitation and with it, lack of focus.
The picture below says it all: if you have a fixed mindset, i.e., if you think that your intelligence or intellectual capacity is something fixed, then you will hinder your progress and will not enjoy the challenge of studying mathematics.
From the book by Carol Dweck, Mindset.
An example: Students with the "I'm good" identity.
Students that have an identity of 'being good' or have a tendency towards perfectionism are the ones that hide themselves. They take every mistake as if it was the end of the world, because, for them, mistakes mean that they are a failure. Therefore, they try not to take on challenges or risks to avoid failure. Sometimes, they do not try really hard, because if they fail, then they can always tell themselves "If I had done it seriously, I would have made it". Their worth as human beings is determined by the marks that they get.
At the end of the day, this type of personality and those with low self-confidence are focused too much on "what does this say about me?", i.e., "what does this mistake say about me?", "What does this mark say about me?", "What does the opinion of others about me?" The two extremes touch themselves.
So stop focusing on what things say about yourself and focus on the thing itself, because, that very thing is what you want, isn't it? Move your attention away from yourself and back to the activity. Then, you will allow mistakes, failure, risks and success.