How to replace the core version in DietPi-RPi ARMv6 Bookworm. img with 6.6.2 or higher?

How to replace the core version in DietPi-RPi ARMv6 Bookworm. img with 6.6.2 or higher?

You mean kernel version? If yes see Image | Raspberry Pi 5: Testing and firmware migration script · Issue #6676 · MichaIng/DietPi · GitHub

If it’s a new fresh installation, better to start with one of the new testing images Index of /downloads/images/testing

Can I customize the kernel myself? For example, the software included.

This is up to you and your knowledge in compiling kernel from source. We use the original kernel from RPi developer and do not maintain it ourselves.