Impaling is a unique enchantment that can be used to add extra damage to mobs when using tridents. In short, when the player is in contact with water, rain, underwater, or fighting aquatic mobs, the enchantment will deal extra damage if placed on a trident.
Also, if you have the highest level of Impaling, you will deal around 20 bonus damage to aquatic mobs. That being said, if you want impaling, the best way is to farm a ton of XP and make books.
You can farm XP by killing mobs, and the best way to farm mobs is to make a mob farm, which you make real easy with a mob spawner.
If you want to know how to make a mob farm, we recommend checking out the video linked above. Once you have a farm, the next step would be to make books and then an enchantment table. You will then need to make 15 bookcases and place them around the table with a one-block buffer zone between the 15 bookcases and the table.
When you are done, you will then need to use books and lapis lazuli to enchant books until you get the Impaling enchantment - this might take a while, but it's a surefire way to get other enchantments you don't have. Keep farming these enchantment books, and you will eventually get Impaling.
Check out some of our other awesome Minecraft guides!