U grade in IIT Madras means you are Unfit for the particular course. Now, this may seem devastating but you don’t have to lose all hope. Try to meet the professor who has given you that grade and hold a meaningful conversation trying to get your point across and understand his viewpoint as well. Teachers don’t want you to suffer, they just want to reprimand you for your improvement.
The U grade might make you feel that you are unable to cope with the IIT standards while others can but trust me many students who were toppers in class 12 face a setback at IIT because the subjects are extremely challenging. It’s best to ask for professors' guidance and important topics to cover.
Once you taste failure, you will become more determined and thus might even work in your favor. Many successful people have terrible failure stories until they achieve success. The immense pressure and high scores of your batch mates might demotivate you but you will have to fight back and come back stronger. Don’t let failure make you feel worthless as many people value you. Just make the most out of your failures.