The film begins with a murder, and Virgil Tibbs is a suspect in the small Mississippi town just for being a black man. Once the town's Sheriff, Gillespie discovers that Tibbs is a top homicide detective from Philadelphia he asks for his help in solving the murder of Colbert of which Virgil was accused. The pair must work together in order to find the actual killer.
Virgil must navigate the segregated Southern town and overcome the many who would rather see him dead than allow him to investigate further. What we find is a town that in persona still represents the racism that was present in the days of slavery, and there is a lack of care for the law as many believe themselves to be the authority as they are either incredibly wealthy and/ or believe their race makes them above it.
Tibbs represents the reality of the identity of black people: strength of mind and character, intelligence, resourceful, capable, etc. He's earned his place as a top detective and allows his work to lead for who he is rather than attempt to bulldoze anyone with the quality of who he is as he understands that that wouldn't get through the ignorance of the people of this Southern town.
In the end, Virgil must overcome being a prime suspect for Colbert's murder, not being trusted by the police with whom he works and the attempt of those trying to kill him. He is able to do all of this when he had only come to this town in order to pass through, which is evidenced by his taking a 4:05am train to Memphis in order to leave the town. But the town had a way of keeping him there with ill intent and in the end he is able to expose a rotten part that existed within it, not from without.