I am a computer science student interested in the field of security and just had a few questions.

What are the pros and cons for using C# for security purposes, I had assumed applications programmed in C# would be more prone to hacking etc. than C++ due to it being a higher level language and therefore being less "powerful" however I have read up online that C++ and C are not usually recommended for security reasons as buffer overflows cause a lot of security problems.

What are the "best" and "worst" programming languages to learn for security and why?
Does it just come down to preference?

Apologies for the vague questions, I am still a beginner, please correct me if I have made any mistakes.

Thanks in advance!