How can I install Linux headers?

I'm trying to install Linux headers in my system using sudo apt-get install build-essential linux-headers-$(uname -r) command. When I run it, it gives me the below error.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-5.10.10
E: Couldn't find any package by glob 'linux-headers-5.10.10'
E: Couldn't find any package by regex 'linux-headers-5.10.10'

To solve this, I upgrade the system and reboot it. But it doesn't work.


You have an unsupported 5.10.10 kernel.

You can't get Linux headers from Ubuntu repositories for this kernel. You should get the headers from the place you got the kernel image.