na-adjective
Describes events, situations, or outcomes that are extremely sad, disastrous, or catastrophic, often with a sense of inevitability or dramatic loss.
彼の死はあまりにも悲劇的だった。
His death was too tragic.
その事故は悲劇的な結末を迎えた。
The accident came to a tragic end.
悲惨 is a noun/adjectival noun meaning 'miserable' or 'wretched', focusing on the pitiful state of suffering, whereas 悲劇的 emphasizes the dramatic, fateful quality of a tragedy.
Formed from 悲劇 (tragedy) + the adjectival suffix 的 (-tic, -like).