I have been lying to my family and friend about university for 2 years now
Why did you lie? How did they react when you had come clean?
They just said I need to stop lying so I stopped and now I am attending University just fine.
You should not lie to your family or friends. That's very wrong and hurtful. They want to know the truth.
I was ashamed to admit that I didn't do as well as I wanted to.
Then good for you for admitting your mistakes and I wish that you will be performing great moving forward with your University studies and I hope you the best. Being honest with your friends and family members is always the better thing to do as they can help you with your problems in your life.