Whether it's feudal Japan or a techno-dystopian future, anime often uses its setting to act as almost a character in its own right. The setting can tell a lot about the story, from the style of clothes to the conflict between traditionalism and modernity. In Demon Slayer, the main characters are all part of a group dedicated to destroying demons, so it's important to know when the show takes place.
Demon Slayer is explicitly set in the Taisho period, which lasted from 1912 to 1926 and was marked by significant transformations in Japan. It was a time of cultural renaissance, when traditional Japanese values were blending with modern ideas. This fusion is reflected in the style of swordsmanship used by the Demon Slayer Corps, which is based on traditional samurai techniques called kenjutsu.
The series also makes heavy use of the culture of the era to give it a sense of authenticity. For example, the use of Hinokami Kagura in the Entertainment District arc shows how traditional Japanese performers used dance to express themselves. This form of art was considered sacred and could only be performed by those of high social rank.
The show is also influenced by the era's ban on swords, which was in effect at the time and made it difficult for people like Tanjiro to carry out their duties as demon hunters. This is why he must keep his sword hidden even when on official Slayer business.