The best detective story is highly subjective and depends on personal taste. That said, there are a few classic mystery/detective stories that have stood the test of time and remain popular even decades after they first emerged.
Here are a few of the most acclaimed detective stories of all time:
The Adventures of Sherlock Holmes by Sir Arthur Conan Doyle – this series of connected stories follows the adventures of the infamous Crime-Solving duo of the Victorian era, Sherlock Holmes and his faithful companion Dr. Watson. Each story is full of suspense and intrigue and has served as an inspiration for detectives stories of all types in the years since.
And Then There Were None by Agatha Christie – this is widely considered to be Christie's masterpiece and it is credited with perfecting the formula of the locked-room mystery that has since been used countless times in other detective stories. It follows a group of strangers who are invited to an isolated location and then start dying one-by-one in mysterious circumstances.
The Hound of the Baskervilles by Arthur Conan Doyle – the third book in the classic Sherlock Holmes series, this story tells of a family who are cursed by a monstrous hound from hell. It is considered to be one of the gothic stories and it certainly lives up to this reputation.
The Maltese Falcon by Dashiell Hammett – this is one of the most influential detective stories ever written and is often credited with starting the "Hard-boiled" detective genre. It follows a private investigator who is hired to locate a priceless statuette known as the Maltese Falcon.
The Big Sleep by Raymond Chandler – this noir crime novel is a classic of the genre. It follows a detective in Los Angeles as he navigates a twisted web of blackmail, murder and deception.
Ultimately, the best detective story is going to depend heavily on personal preference. For more recommendations, you can check out this list of classic detective novels:
https://www.goodreads.com/list/show/3784.Best_Detective_Fiction_Mystery_Books