for eg. A device driver is about exposing an interface for other programs being run on your computer, to access and control a device...
https://m.youtube.com/watch?v=juGNPLdjLH4 this is a decent crash course on that.
You can create a toy USB device using an Arduino or something that can send / receive information to your PC. Eg: https://m.youtube.com/watch?v=yTc2GLXfCOY .
Then it's a matter of just understanding what the subsystem you're interested in writing drivers for your OS does, how to make it do something, just write code. Storage devices, graphics devices, etc...
A raspberry pi can be a decent starting point for these experiments too.. eg. Writing a bare metal operating system for the raspberry pi https://github.com/babbleberry/rpi4-osdev
I got to implement a simple server (Minix is a μkernel so that's how most drivers work) and do some kernel hacking. I read the course material in advance and didn't even attend any lectures, still got an 8/10 grade ^^
I've also heard many good things about NetBSD and of course SerenityOS (Andreas did a lot of development on live streams).
It is indeed easy once you know where to start.
1. You need a programming language that capable of output the machine code for your target CPU. Better to be a language that does not have GC or runtime like Rust/C++/C/Zig. If you are not familiar with low-level language I recommend C as a first step since it is easy to find examples on the internet.
2. Learn the basic of assembly language of your target CPU. You need this because the above language may not provide the intrinsic functions for some instructions.
3. Start writing a hello world kernel. You can find a bunch of tutorial on the internet, especially for x86.
4. With step 3 you should already learned how the CPU start your kernel and how many mode and privilege level available on the CPU. Usually the CPU will give you the highest privilege level when jumping into your code.
5. Now you need to setup the CPU into whatever you want. For example, you likely need to switch the CPU to long mode on x86 so you can use 64-bits instructions. In this step you likely need to setup a virtual memory. You can find a reference for your CPU from their website.
6. If you have reached this step then congratulations! You should already have some idea how the CPU is working with the OS and how to enumerate available devices to discover its memory location. There are a ton of works that need to be done once you are here like implementing filesystem, scheduler, etc.
Remember that the only different between the software that run on the OS and the OS kernel is mode of the CPU currently executing its code. With highest privilege level you can use some instructions that are not available to the normal application.
Andrew Tanenbaum "Modern Operating Systems" (The Red Book)