For the struggling master student anon:
I understand the feeling when you do badly in a course, it can feel very catastrophic and when it happens at the beginning of your studies, it affects your self esteem a lot.
As someone who's currently working in a college, I want to tell you that the grade of one course in your master's degree matters very little in your future prospects. For employers, they couldn't really care less about the marks of individual courses, and for professors, whether you are accepted into a good PhD program depends a lot more on your proposal and related experience instead of grades. I'd say it's too early to determine whether you're cut out for the masters, because we need time to adjust to the workload and routine of a new programme. Give yourself another semester and evaluate again, and definitely seek help from university counsellors! Some of them are a-holes, but most are nice and are willing to help.
On your PhD programme, depending on your profession, I'd like to suggest working for a while first, gather field experience before going into PhD. Getting a PhD is not easy (duh), and can easily take years. Before determining whether a PhD program is useful for you, or suits you, I think it would be rather important to go into the field and meet different people first, see what are your possibilities and learn more about different professors/culture of unis (after all, ranking isn't everything and the professor's specialty and experience is way more important). I think there's no need to fret over PhD placement at this moment, because there's still a long time and even if you don't get it this year, you can still accumulate more practical experience and try again next year. If anything, practical experiences and a wider network allows you to do your research way easier too.
I wish you all the best and don't worry too much about grades! The most important thing is you get something useful out of it and you enjoyed it.
bless you for this, thank you ♡