They give you a form to show the loss. Your accountant
Uses it to reduce your tax liability when filing tax return. I sold a rental and had lots of capital gains. My accountant somehow used it and I pay a lot less taxes. You only lose on paper. The money in your account grows more.