From the Super Mario Wiki
Possessed Chests are uncommon enemies found throughout The Last Resort in Luigi's Mansion 3. They are treasure chests brought to life by purple Spirit Balls. They will remain stationary, snarling and constantly trying to bite the player, however it can only hurt them and make them lose 20 HP if they get too close.
To defeat the Possessed Chest, the player must use their Poltergust G-00 to grab something and shoot it at the Possessed Chest to daze it, or have Gooigi get eaten and drop its guard while it is chewing on him, then get the purple Spirit Balls out of them using the Dark-Light Device. Then the player must suck up the purple Spirit Balls with the Poltergust G-00, and the Possessed Chest will turn back into a regular treasure chest.