First is the cost of your Bitcoin mining hardware. Bitcoin miners can range from $200 for a used Bitmain S9 Bitcoin Miner, all the way to $9,000 for a Bitfury Tardis B8. The bear market has created a timely investment opportunity by drastically reducing the cost of Bitcoin mining hardware. The Bitmain S9 Bitcoin miner went for over $5,000 at the market's peak, they now sell for less than $500 new. To learn more mining hardware, read our post about The Best Bitcoin Mining Hardware of 2019.
Second is the cost of your electricity to keep your Bitcoin mining hardware running. This is by far the most important factor to a profitable mining operation as Bitcoin miners require a substantial amount of power. To be profitable with Bitcoin mining, your miners need to produce more Bitcoin per month than your monthly operation costs to run the hardware. To achieve this you'll need to partner with a mining hosting provider or have access to a cheap enough power rate.
These two are the most important, but you'll also have to consider things like the cost of keeping your hardware cool. Storage costs can play a role as well if you're unable to maintain a mining rig in your living space. Most reputable hosting providers include storage, security, and cooling in their hosting rate.
It's hard to put forth a definitive “formula” for profiting with Bitcoin mining, and the topic is regularly debated. There are, however, some general guidelines and actions one can take to ensure their rig is always pumping your wallet as full as possible. If you are still new to the game, read our post How To Mine Bitcoin.