The typical way one would sell stocks that they do not own would be to borrow the stock from a holder and then sell them in the open market. The lender of the stock would continue to maintain their rights as an owner, including the right to recall and sell the stock, as well as any interim benefits such as stock and cash dividends. Upon the end of the strategy, the borrower/shorter would close the position by buying the stock and returning it to the lender.
The stock loan is generally facilitated by the custodian. The custodian would "locate" the stock to loan from one of their accounts that is long the stock and let the short seller borrow the stock for the fees, interest, and any interim benefits (generally cash dividends) the long would have received. They would then pass on these benefits to the lender of the stock, and in addition possibly a share of the fee and interest charges received from the borrower. As the lender of the stock maintains its right to recall and sell the stock, this would basically be a series of overnight loans.
Another way one could acquire the stocks to short would be a "synthetic stock loan". In this transaction, one would buy the stock and sell a future on the stock. They could then sell the stock for their short position. While maintaining the strategy, they would roll futures. Upon the end of the strategy, they would buy the future, deliver the stock, or reverse the whole "synthetic stock loan" trade. Futures prices have embedded in them financing (interest) charges and the expected dividends incorporated in the futures price. As futures have fixed maturities, these are basically term loans of the stock. As term loans, there will be some "basis" risk during the holding period. Also, the investor would need to post margin to maintain the short futures position.
Of course there are a number of equity finance transactions that could be done instead of selling the future, such as selling a total return swap via a OTC contract.
While I briefly described the shorting process of equities, there is an analogous market for fixed income instruments. The repo market is used for borrowing bonds, and bond futures are also available. Bond futures are more complicated in that there is optionality built into the contract, such as "cheapest-to-deliver" and "wild card" options.
As one can see, getting short can be quite complicated.