Once you have the Bitrise CLI installed, to generate a new Bitrise Step all you have to do is:

# If this is the very first time you use the CLI / if you just installed the CLI run this:
bitrise setup
# If you want to update the step plugin to the latest version:
bitrise plugin update step
# And to generate a new step simply run this command and follow the guide it prints:
bitrise :step create

The generated Step's README also describes how you can run your step locally,
before you'd even commit the code, as well as how you can test and use your step
in any build by using the git:: step reference, and finally (and optionally)
how you can share your step with others through the Bitrise StepLib.