Installing a Linux distribution is of course a reasonable prerequisite - Linux is self-hosting, in that it can (probably) only be compiled under a GNU/Linux system (with gcc and the gnu C library - although the C library is only used in tools during compilation - it isn't linked into the kernel). Numerous other tools are also required to compile Linux, which are documented.
Getting the source code is easy enough, but the difficult bit is configuring the kernel correctly for your machine - therefore you probably want to use your distribution's kernel source instead (which may have patches but they will be insignificant for your purposes).
The easiest way to "try out" kernel programming is to write a kernel module - these can be dynamically loaded (which means you can test your code without a reboot - provided it doesn't crash the system)
There are loads of examples of kernel modules around, however almost all of them are obsolete due to the fast-changing internal APIs in the kernel itself (even the build system changes relatively rapidly).
Kernel modules can do almost anything that doesn't involve directly changing a core part of the kernel - there are a lot of "hook" functions (mostly register_something to register a device, hook, protocol, etc) which can be used to extend the kernel's userspace API or modify its behaviour in some way.