Don't let anyone tell you what you cannot do. In all likelihood, they're saying so because, in reality, they are the ones who cannot do it and so, they're comparing themselves with you, and basis that, they feel that you also cannot do it. Their opinion is a reflection of their own inabilities.
Here are a few instances when I faced this and emerged successful:
1. Back in class 6th, when my parents got me admitted to Kanpur's best school, the Principal told my father "he has been doing well in his earlier school but it would not be possible for him to maintain that in our school". She was initially correct because I started with a rank of 23rd in a class of ~50. But then I worked hard and eventually reached the 1st rank in class 9th, and topped the school in class 10th Board exams with 97.4% marks.
2. When I started my preparation for JEE Advanced, I had one goal in mind - to crack IIT Bombay, CSE. Everyone told me that I was being too ambitious and that only 50 people every year make it to IITB CSE. They were initially correct - I scored merely 153/240 in my first all-India test when the highest was 232/240. But then I worked hard and ended up with AIR 33 in JEE 2013, joining IITB CSE and fulfilling my dream.
3. When my previous cofounder quit in 2018, everyone told me that I should shut the startup and take a job. They were initially correct - I had less than Rs. 5 lakhs ($6000) left in the Bank and just 1 intern and 1 full-time employee. But then I worked hard and persisted and today, we are 150+ members and multi-million dollars in revenue.
Hard work is one parameter that you can completely control. People will try to tell you that you're mediocre. They'll tell you that you can't succeed. They'll tell you that you cannot do it. Don't listen to anyone. Focus on your hard work and keep surprising people with your wins.
I have shared a lot of my learnings about Business and Entrepreneurship on my YouTube Channel. Please check it here: https://firstname.lastname@example.org