To destroy the ship attacking your ship in level 1 of LEGO Marvel Super Heroes 2 go over to the fires and build the remote controller with Rocket Raccoon:
Use the remote controller to activate the gun on your ship. Climb up to the top of the ship by jumping up to the side of the ship with the ladder:
Use the gun to kill the attacking ship. You will need to lead your shots a little to hit the enemy ship.