This question already has an answer here:
With my understanding and from an absolute knowledge of the subject, that according to JK Rowling, wizards and witches are born with their magic and it's a part of their DNA. Magical people are genetically somewhat different from Muggles, and this difference is the reason for their magical abilities. (Extracted from posts of this page)
And other information source:
Can a wizard lose his magic and become a squib or somthing like this? If this is possible, can you explain how it would work?
EDIT 1: Why this question doesn't answer my question
All of the examples of the answer are affected or produced by emotional trauma or psychological state, and would presumably be reversible if the wizard gets to a better mental state. However I'm looking for a way to entirely "delete" a wizard's ability to use magic or otherwise render their magical powers unusable.
In the examples given in the answers, the characters never lose their magical ability to the point where it would be impossible for them to regain their powers. They are only in a temporary state where they are unable to use their magic - they don't permanently lose their powers. I'm asking about a situation where this is actually a permanent state, or if there's a way to make the temporary state permanent.
The answer may possibly be outdated in some things, for example the Ariana Dumbledore case. In "Fantastic Beasts and Where to Find Them" the existence of the Obscurus gives an explanation for what happens in these cases... It's not confirmed yet as canonical to say this is what happened to Ariana, but her symptoms as described are very similar to those of one of the characters in "Fantastic Beasts and Where to Find Them".