Have you tested the pendrive on another PC? Is it working fine there? If it is, backup all data. If the pendrive is not working while connected to any Windows PC, but seems working fine when connected to a phone, there may be a connectivity issue. Sometimes drives with connectivity problems do not appear in Windows, but are recognized by other operational systems. It is a good opportunity to backup all important files.
When you connect the pendrive to a PC, does it appear in Disk Management? Does it have a proper file format and a drive letter?