The following might be helpful.
quote Kingdom Hearts Wiki
For the final boss fight of Terra's scenario, the player takes control of the Lingering Sentiment in order to battle Terra-Xehanort. It will have access to any abilities Terra had equipped before the battle such as, its Keyblade preset to the Ends of the Earth. No D-Links can be used during this battle, but Command Styles and Shotlocks are still available.
In early stages of the battle, Terra-Xehanort will immediately go on the offense, usually dashing around the battlefield, surrounded in darkness. The player's best defense against this tactic is to use Guard and immediately follow with a Counter Hammer. This will do great amounts of damage to Terra-Xehanort, causing him to warp away. When the boss reappears, he may attempt a fast-paced physical attack similar to Terra's Ars Solum ability. This can be Guarded against, opening the boss to damage from Counter Hammer. He may also utilize the Shotlock Dark Volley, but the dark projectiles he fires can be deflected back at him to deal damage with Guard. Should one attempt a physical attack of their own against Terra-Xehanort, be advised that the best place to strike is from behind. This is mainly because Terra-Xehanort also has access to the Guard and Counter Hammer combo.
As Terra-Xehanort's HP starts to dwindle, his true power is unleashed. He may use a variation of the Meteor spell, causing several large rocks to erupt from the ground and bombard the player. While this attack can potentially deal heavy damage, it can be defended against with a well-timed Guard. He may also summon a large meteor if the player is at close range. Usually when the player is at close range, Terra-Xehanort may cause large pillars of rock to shoot out from the ground around him, in a similar fashion to the Quake spell.
He will continue to use the Darkness-based attacks from earlier stages of the battle, which can be defended against in the same ways mentioned above. Terra-Xehanort may also use the Dark Impulse Command Style, which involves him landing several hits with his Keyblade and then striking the player with an immense hand of dark energy (which can break through Guard, so dodging is advisable). Terra-Xehanort will then vanish into the ground, visible only as a pool of darkness on the ground. This pool will travel underneath the player, during which time the boss will attempt another dark hand attack. This attack requires precise timing to dodge, the player needing to wait for the pool of darkness to travel beneath them and then using the Slide ability, which can also be used to avoid many of Terra-Xehanort's attacks or get the Lingering Sentiment out of attack range. As Terra-Xehanort's HP lowers even further, he will chain the close-range rock pillar attack with the Meteor spell.
He lastly will have access to the deadliest attack in his arsenal, Terra's Ultima Cannon Shotlock. Similar to when the Lingering Sentiment is fought as a boss in Kingdom Hearts II Final Mix, Terra-Xehanort will enlarge the Keyblade and charge its power, firing a single, large orb of energy to hit the player. This attack will deal a great amount of damage, and cannot be defended against with Guard like in Kingdom Hearts II Final Mix. Instead, the player must do whatever they can to stay as far away from the boss as possible. Also, beware when Terra-Xehanort's HP is low as he starts teleporting more frequently.
In short, this battle against Terra-Xehanort is all about an equal balance of defense and offense. Defensive abilities should be used which then link to an offensive attack, such as the Guard and Counter Hammer combo. This way, most damage is avoided while the player can still deal heavy damage to the boss. One should also be careful when executing the Curaga spell. While this will fully restore the player's HP, Terra-Xehanort can heal as well, increasing the length of the battle. So long as the correct strategies are followed and the player uses patience, Terra-Xehanort will fall and Terra's scenario will have been completed.