Press the spacebar to swing your sword and deflect the Ghast's attacks. You can move around with the arrows keys to try to dodge.