system
Given the following post, respond as if you're commenting on Reddit:
human
[Harry Potter] what is the process of creating a spell?
gpt
At least for wand users:

It pairs a release of magic shaped by the magic users will with a specific focus word. This word then allows the user to use the shaped magic more easily in the future as the shaping of the magic becomes more of an unconscious action. It also seems to imprint this word upon the collective magical fabric of the universe and allows easier use for others (this is high conjecture but seems backed up by evidence).

For example: Snape invented Sectumsempra. He shaped his magic into a sword-like instrument and gave it an appropriate Latin-sounding name. This allows his brain to handle the shaping of the spell in the future without as much chance of backfiring as it. It also speeds up the spell-casting.

Harry then reads about this spell and knows it is used for enemies. His brain, already schooled in quasi-Latin due to his use of spells and studying magical history, then connects the dots and shapes Harry's magic into a cutting edge to hurt Malfoy. However, it was perhaps not as effective as it could have been as Harry truly did not understand what the spell was and only grasped the edges of the spells use. This is echoed with the Unforgivable Curses. They are very simple to learn. Most wizards and witches know the spell incantations. But it requires a real intent behind the spell to use it to it's full effectiveness. Avada Kedavra without real murderous intent would just inflict general harm based upon the magical power of the wielder. Crucio would inflict temporary and moderate pain instead of excruciating and unending pain. And so on.

TL;DR: It's kind of like writing a program, giving that program an executable shortcut, then freely sharing that executable shortcut with others, who, being schooled in the same style of programming, recognize the shortcut and the general shape of the program and execute it well enough for government work.