What weapons were used to attack a castle?
Under, over or through the wall at some point or points. Better still, just prevent food & water from the defenders: Siege. It might be possible to undermine the walls by tunnelling. It might be possible to scale the walls with a tower or ladders. Or batter a doorway or wall. Or any combination thereof. Ballistas, Mangonels & Trebuchets were means of throwing rocks & suchlike. But what saw the end for castles in the long term was gunpowder, although the storming of fortifications was still a costly enterprise. The castle still existed even into WW2, the example of the German attack on Eben Emael in Belgium is a classic of airborne warfare, the defenders didn’t expect to be attacked by parachutists !