The short answer
Several Hindi films are set around the 1999 Kargil War. Three well-known examples are LoC: Kargil (2003), Lakshya (2004) and Shershaah (2021). This list is not complete, and other films and TV dramas have also dealt with the conflict.
LoC: Kargil (2003)
LoC: Kargil, directed by J.P. Dutta, is a large-scale war film that dramatizes the fighting. It follows several soldiers and combines real events with fictional characters and scenes.
Lakshya (2004)
Lakshya, directed by Farhan Akhtar, is a coming-of-age story about a young man who joins the Army. Its story is set partly against the Kargil fighting, but its main characters are fictional.
Shershaah (2021)
Shershaah, directed by Vishnuvardhan, is a biographical film about Captain Vikram Batra, an Indian Army officer who was killed in the Kargil fighting in 1999. Batra was awarded the Param Vir Chakra, India’s highest military award for valor, after his death.
How closely films follow real events
War films usually compress timelines, combine characters, and invent dialogue and scenes to make the story work. A film can capture the general course of the conflict while changing many details. If you want to know what happened, use a historical overview alongside the film, and treat the movie as a dramatization.