Castles could be attacked using a variety of weapons:
If a castle could not be captured in a battle, the attacking army would hold a siege where they would surround it so no one could get out until they surrendered. This often took a few months however and lasted until everyone inside ran out of food or became ill.
The attackers would: poison the water supply, shoot in fire arrows to burn barns containing food, cause disease by throwing over dead animals and bribe the guards to let them inside. The people being besieged sometimes ended up eating rats to stay alive and would try to smuggle in food and send messages out to their friends.