I have tried all kinds of online tutorials, such as udemy, learncs.org, pluralSight.com, and some others, but i can"t seem to learn it. So where can i, and what am i doing wrong?
First, are you learning C# in the context of Unity, or using an IDE like Visual Studio to create applications outside of Unity?
I’ve not looked into books of late, but back in the day I was fond of the “teach yourself (language x) in 21 days”, and the “(language x) for dummies” series. I’ve been at this for decades, and a new language is trivial for me at this stage, so I’ve not examined any learning materials of late beyond descriptions of new language features as they evolve.
How long have you been attempting the study? The learning curve for C++, which is a nasty language (that’s an admission I make, but it is by far my preferred language) is perhaps 2 years. It was once claimed to be 18 months, but that was in the 90’s when it was about 60% to 70% of what it is now. C# should be faster, but I’d still expect several months to a year for competency (but keep in mind, my standards are high, so I’m describing an employable engineer otherwise familiar with math, computer science, etc).
Are you able to write something simple that demonstrates the basic syntax and concepts? If/else, switch, functions, member variables, classes?
Back in the 70’s, which is now ancient I know, but I was a kid at a time when owning a computer had just become possible. Before '76 you just wouldn’t find a computer in a home. In '78 there were at least a few makers, and I started out on a TRS-80 in BASIC. That quickly became a study of Z80 assembler, because the machines were so slow (hundreds of thousands, perhaps millions of times slower than modern computers), there just wasn’t any other way to get them to do much quickly.
BASIC is a very, very simple language. It was intended to be used for teaching beginners. C# was designed by corporation as a counterpunch against Java, itself a more academic oriented creation of another corporation. C, on the other hand, was created by academics in a highly controlled monopoly (AT&T), and had all the attributes of a scholarly creation of the period. The syntax you’re learning in C# is based on that early work which dates from about '69 (officially 1970).
Beyond the language there is computer science. That isn’t something other than, it is part of what you’re trying to learn. This means you’re actually learning two subjects at once, perhaps without realizing it.
Computer science deals with, among a great many things, the way data is sorted, compared, stored and shaped. It is also the way lines and circles are drawn on a pixelated display (dates from '68 - look up Bresenham, computers graphics starts with lines, and lines started with Bresenham - in a way).
The point is you will have to be patient. The subject is deep, far deeper than about 70% of the programmers I’ve hired (and fired) over the decades, ever realize.
Keep trying. Keep practicing. The state of mind you should expect to experience before you learn something is confusion. It is the symptom of an act of mind you should want. The confusion may cause anxiety, which everyone needs to learn to let go of. Confusion is the symptom of a mind that has just come to realize what it doesn’t understand. The mind has finally wrapped around the questions, puzzled over the meanings, and can sense the contours of the problems, but doesn’t yet comprehend it all. That’s when it begins to happen. The outline of that contour causing the confusing is the outline of the solution, and the state of exasperation is part of the effort exerted to feel the outline of the subject. The brain was made to do this and succeed at it. The first blockage that sidelines most of us is the anxiety it causes, but that’s like the strain of muscles being worked, it is part of the act.
At some point, after everything you’ve tried doesn’t work, something will. It may be small and unimpressive, but the fact it falls into place will be an opening. Look forward to it. That will be repeated many times, and each opening will lead to new ones.
I dabbled in electronics for years, it is part of what drew me toward computers. When I was a kid I tried to build example circuits, which in the 70’s means stereo amplifiers, power supplies, mixers…but everything failed. I blew the top off of hundreds of transistors. Finally, some phono-preamp worked when I built it. After that, for whatever reason, almost everything I built worked. Something had just clicked, and I couldn’t even say what it was.
As long as you’re experimenting, you’re not doing anything wrong. They’re all just compiler complaints, and it doesn’t always say what it means anyway