How do you get the your magic on your weapons

Like a lighting sunkun sword ( infusion )

you have to awaken as a conjurer

yes conjurer, further on savants will gain the ability on second awakening

To get the lightning sunken sword, you need to start with lightning magic, progress as a conjurer (focus on weapon and magic stats) and awaken. This ability is called imbuement and it is on any weapon with awakened conjurer (or warlord or warlock)