Best Buy Co. reported another dismal quarter Tuesday, recording a loss in the third quarter, hurt by a continued sales slump and charges related to restructuring.

The electronics chain is struggling to reverse a yearslong decline in its business as competition from online stores and discounters increases, and consumers’ tastes shift from more profitable items like TVs and desktop computers toward less profitable smartphones and tablets.