If you write a put option you are committed to buying the shares at the strike price if the stock price drops below the strike price at expiry.
The maximum gain a put option writer could gain is the amount of premium collected. This happens if the stock price ends above the strike price at expiry.
Theoretically, a put option writer could lose an amount equal to (strike price – premium collected). This happens when the stock price goes to zero.
Example: Suppose the premium collected to write one contract of $40 strike put option is 2 * 100 = $200.
If the stock price goes to 0, then the loss = (40 – 2)*100 = $3,800