Show installed kernels:

rpm -q kernel

On Fedora 22 and newer:

dnf install yum-utils

On earlier Fedora, CentOS and RedHat (RHEL):

yum install yum-utils

Run the actual cleanup, whereas 2 is in this case the number of kernels that you want to keep:

package-cleanup --oldkernels --count=2