The most wide use is as an intermediate step during the compile process, often hidden by the outer compiler command line or gui code. The compiler produces assembly code then an assembler is called to turn that into some flavor of binary (object or an executable form). Not uncommon for the compiler command line or gui shell to call the linker so that the user only sees source code go in and an executable come out.
Not all compilers do this, tcc for example has the "machine code" hard coded in the compiler.
Having an intermediate ascii assembly language step separates the compiler development from the assembler development. Compiler writers can directly see the output of their work, they dont have to disassemble (which on some platforms is problematic) to figure out what their compiler produced. the assembler program/tool has to be there anyway, so might as well leverage it instead of re-invent it in the compiler.
bootloaders and startup and shutdown code that leads and follows compiled code often needs to be written in assembly language because hand written assembly doesnt have to conform to calling standards, where compiler generated assembly does often conform to a calling standard. Someone has to setup the stack and zero .bss memory and those sorts of tasks before the compiled code can operate using its calling convention.
Sometimes assembly is used for hand optimizing something the compiler and or language was not able to not produce fast enough code for the problem being solved.
Microcontrollers, both because some use cpus that do not have enough of a market to produce a great compiler, and because they are very resource limited to the point that having to double or triple the clock speed or amount of ram/rom to use compiled code is not worth it. You will find a larger percentage of this market uses asm compared to normal applications and operating systems.
Hopefully learning for educational purposes is a reason to use asm. Once you learn even one, esp if you learn a few different instruction sets, you both gain an appreciation for what the compiler and language is doing, and often as a result of this education you write better (performance and reliability) high level language code.