Answer:
The most common method of attacking any castle was the siege - a war of attrition, the attackers would seek to cut off the fortification from the outside world, hoping that starvation and disease would force the defenders into a surrender without a shot needing to be fired. Indeed, for some of the most highly evolved castles their defenses were so strong that this might have been the only type of attack that had a significant chance of victory.
Numerous weapons of war were constructed to combat the fortifications of castles, however. Simple catapults were often used to hurl boulders at the walls with the intention of knocking them down by brute force, and more evolved catapults such as trebuchets continued this tradition.
Assaulting a castle at close-range was often extremely dangerous, but when attempted it was common for battering rams to be used, either to force open the doors where possible, or even try to weaken the structure of the walls. Ladders were risky ways of trying to climb over the top of the castle walls to assault the defenders directly. Eventually such devices as siege towers came into play - simply, these were large wooden towers, often covered with leather to protect against arrows, which were moved into position next to the walls of the castle so that attackers could climb up the ladders inside in safety.
More complicated methods of attack included sapping, whereby a tunnel would be dug directly under the walls of the tower so as to cause them to become unstable and collapse. Moats deterred many of these methods of attack, and it was a risky endeavour indeed to try and fill them in.
Ultimately, the cannon became the ultimate weapon to use against castles. The age of gunpowder effectively killed the castle.