Good question, difficult answer.
Steampunk in fiction, is an aesthetic; in exactly the same way that a Western is an aesthetic – a look and feel that permeates the very fabric of your story. You can tell any type of story you like in a Steampunk aesthetic, just as you can tell any story you want set as a Western. However, as with a Western built world, there are certain tropes and stereotypes that help to move the aesthetic along and which readers expect to see.
Your characters can wear Victorian clothing and your cities can be built with Victorian architecture, but that won’t make your story Steampunk. You can fill your story world with steam engines and other gadgets, but that won’t make your story steampunk. You can include all the optimistic retro-futurism you like, but that still won’t make your story Steampunk. Which is why this is a difficult question to answer.
So how do you create a Steampunk world?
All the tropes and classic elements of Steampunk need to be there in your worldbuilding, but they also need to form organic elements of your story construction. So your Victorian-esque city, needs to incorporate the things that made a Victorian city a Victorian city: a few very rich people in control and the vast majority being exploited to provide their wealth, grinding poverty & belief in the saving power of hard work, optimism in technical progress, altruistic individuals/societies providing charity to the masses, little social mobility between the classes, a brand new middle-class.
Now here’s the thing about a Steampunk aesthetic: provided all the underlying mechanisms of a Victorian city are in place and have been woven into the fabric of your story/plot, your city doesn’t even have to look Victorian – just feel like one.
Also, bizarrely, because may proponents of Steampunk are in the US and western expansion in the US roughly coincided with the Victorian era in Europe, you can include element of the Wild West in Steampunk stories (known as Weird West). There are also Steampunks in India, historically a highly stratified, and caste society. Also in Japan, again historically a highly stratified society. You can work all these elements into your story workd if you want – hey, it’s an aesthetic, no one said it was logical.
The same goes for steam engines. What makes a steam engine more fascinating than computer technology – gears, cogs, oil, smells, sounds, you can see how it works, you can see it working, you can understand what it is doing – Steampunk taps into this desire to see, hear, smell a thing at work. More than that, in a Steampunk aesthetic, your machines become characters in the story. Your plot/story revolves around the machines in some way. Given your story/plot/story world includes these elements, you don’t even need actual steam engines.
What about those Steampunk clothes? Again, they must be a part of the story as well as the story world. What is it about the society in your Steampunk world that encourages/dictates the clothes they wear? Victorian society was highly stratified and regimented: eveyone wore a kind of uniform – the Victorians loved uniforms and dressing up / Steampunks love uniforms and dressing up – everyone could tell what class/caste you belong to and what job you did from the way you were dressed. Unless, of course, you were in your finest, in which case you were trying to conceal your class/cast/job and be all middle class. These are the stylistic mechanisms you need to build into your story world – don’t just chuck in cosplay costumes for the sake of it. Unlike the other Steampunk tropes and elements, the costumes are a must, but you can stretch the boundaries and be inventive.
Finally, what about the ‘punk’ in Steampunk? This is all about the attitudes of your main characters or protagonist. This is a mix of optimism and an attitude that says ‘stick it to society’. Plucky and adventurous heroes and heroines are the order of the day. However, let’s face it, we are pretty glad the Victorian era is in the past, aren’t we? So in some sense, the whole Victorianess of the Steampunk aesthetic is also a villain in the story world. Your protagonists are generally trying to make life better, to overcome the horrors of the Victorian/Wild West era, and progress to a better future – maybe a more equal, feminist, more socially mobile future – whilst your villains eagerly embrace all the worst of the age, for their own gain.
From a worldbuilding perspective, I hope that helps explain the mystery of Steampunk.