I’m not a programmer, just solving some puzzles in c#, so I no need to it for now, but out of curiosity googled how it works and I’m a bit confused.
My question is are programmer actually need to know parameters of machine on which his program works and do some logic around it? Like, on this machine we can not split into 8 threads, so we need to do only 4, for example. Or for multithreading you just do new Thread and framework will figured out himself?

If you use a threadpool, the Task Parallel Library, or Parallel LINQ, then the runtime will determine how many threads to create based on your computer’s CPU count.

It can also automatically create new threads if some threads are blocked while waiting for disk or network access. (Though if you use async/await correctly, threads won’t be blocked in the first place.)
In short, we almost never need to think about how many CPUs a machine has.

Correct, except for some Parallel.For or Parallel.ForEach which if not given the maximum degree of concurrency might potentially create an very high number of threads, regardless of the number of cores on the host machine. It all depends whether the code in the loop is CPU-bound or IO-bound.
But you can get that information from Environment.ProcessorCount and use it to setup the loop in a ParallelOptions object.

Thanks, would you kindly also link me something about async/await? I’m a bit understand how to use it, but how it implemented. Especially about how it works even if it running at one core.

It depends on what you are after. C# provides some good tools that let it essentially just work out the threads it needs by requesting as many as it can get. Normally that is all handled by the thread pool.
I have in specific situations actually checked for max threads and assigned based on that but it is very rare in my experience.

In some contexts you would check threads and manage them yourself but C# is not normally the language used in those contexts. That would be more in the HPC realm where C++ tends to be the dominant choice, though I could see C# possibly making inroads into that space in the future.
C# provides some good tools that let it essentially just work out the threads it needs by requesting as many as it can get
So, every c# app is multithread app?
C# devs
null reference exceptions

source