To prevent updates to certain packages, you could use dnf versionlock.
Install dnf install python3-dnf-plugin-versionlock, then lock packages that you want to avoid upgrading, e.g. kernel dnf versionlock kernel-*. See DNF versionlock Plugin — dnf-plugins-core 4.4.1-1 documentation .