A novel I read in the 90's or early 2000's.
The hero is a young apprentice to some version of telekinetic wizards. They can attract (or repel) parts of the same object. It is currently a siege and the master uses this power to destroy a catapult.
The siege is successful and the castle is taken. The apprentice escapes with a McGuffin. Now masterless, he starts investigating it.
He starts at the guild of alchemists and learns a few months. They finally figure out it's sorcery.
He spends less time thereat the sorcerers guild, possibly going underwater? He finally figures out it's some kind of demon summoning object.
Along the way, he learns to fight with sword and shield. His trainer pronounces him competent but too small to be a professional.
Finally,
he trains very briefly as a demon summoner. He summons the arch demon, defeats it and gets on with life. A side plot along the story is the increase in demons due to failed summonings.
Obviously, this should be easy to figure out. Unfortunately, it is remarkably hard to google, as I found out.