How to detect custom names and enchants

i want to make a trident spawn lightning when it hits the gorund and have the name "Lightning Trident" and has the enchant loyalty

Continue to help post