You essentially purchase a share into the stock from a random person and sell it immediately on the market at the current price with a promise to sell it future value in the future.
You don't actually take the money right away but a broker holds it for you.
Say Acme is worth 100$ today and you think it'll go down to 80$ in a week. You give the broker a small betting fee. So you give him 101$, he makes the purchase and holds the "position" for you.
During that week the price could do 2 things.
The Good Scenario: Price goes down to 80$. Broker buys the stock at 80$ and pockets a nice shiny 1$. You pocket 20$.
The Bad Scenario: Price goes up to 120$. Broker buys the stock at 120$ and pockets a nice shiny 1$. You owe broker 21$.
I say 1$ but it's actually more complicated than that. Some brokers allow you to do short positions only if you have other stock with them as collateral which they would sell to pay for whatever loss you might have. Shorting is a risky business because shares could go up to infinity and you could lose everything with these positions.
When people say they're "long on this stock" means they think it'll go up in price. "short on this stock" means they think it'll godown in price. It's lingo they love to use.
So the people you make it from are from people betting the opposite as you. Another person could make the opposite bet as you and end up losing their money that you pocket.