Well constructed medevial fortresses imposed such a high cost on any attackers that were rarely attempts to assault them directly. There was almost always an easier way.
However if was a city or sometimes a large town, the calculus changes because the payoff was much higher. Also it may not have always been possible to wait the defenders out - because of relief armies and the troops getting restless and possibly deserting. An example in the "medevial" period (lets say ~1050-1453) where walls were directly attacked would be Jerusalem
I remember watching a video about a siege the Romans did, lasting a few years or so, where they built a whole friggin ramp up to the fortress, where otherwise they would only have had a thin path up, which would have been impossible to get siege towers and stuff up. Mind-blowing stuff.
Its quite fascinating and defensive innovations drove alot of interesting architechture. For example machiolations were a response to sapping being used especially by Saracen armies (who seemed to favor sapping more than Europeans) against the Crusaders.
Also the movement from square towers to round ones, once again as a defense for sapping, and displacing the tower from the wall or keep in order to be able to flank assaulters attempting an escalade.
The mastery of stone fortifications made walls nearly impregnable to breaches until cannons were developed, and even by then it was a dodgy proposiiton. For instance at Constantinople in 1453 the Turks had huge cannon which could damage the walls, yet it was not the reason the city fell. The defenders were able to repair the walls before the cannon could reload for a second shot. The reason Constantinople fell was a side gate was left open (either intentionally or accidentally) which allowed the Turks to pour through. There were alot of incidents like this such as the defenders of the Krak de Chevaliers (in modern day Syria) being duped into believing their commander had ordered their surrender
Round towers and concentric design started to become popular in the 13th century which was well before cannon were useful. Cannon were not all that practical until the mid-15th century, which is when you started to see the "star" fort design, and the replacement of stone with earth and brick, lower walls that were more sloped.
Bring food. LOTS of it.
Wait.
(However, it's apparently easier to do it the fast way. Food storage in the field was quite difficult, and supply lines are vulnerable.)