It may be the case you went from a class where you were the smartest person in the room to where you are now in a room with a lot of very smart people. So while it may feel like you have got worse, in reality, the competition is just much better than you're used to.
It seems like motivation is as much a problem as the difficulty. Think about why you wanted to go to uni. Perhaps you achieved a long standing goal of wanting to prove you are good enough to get it uni but not yet set new goals which will help with motivation. I failed an exam in the first year. It happens to everyone at some point.