What are the ways of attacking a castle?

use a catapult

use a battering ram