Leftover prescription medicines were given for a specific person, condition and dose at a particular time. Using them again for what seems like the same problem can be unsafe, because the cause may be different, the dose may no longer be right, or the medicine may have expired and lost strength.
This is a particular concern with antibiotics. Taking leftover antibiotics, or someone else's, can mean the wrong drug for the infection, an incomplete dose, and a contribution to antibiotic resistance. It can also delay getting the right treatment.
If symptoms return, it is better to see a doctor or pharmacist for a fresh assessment than to self-treat with old supplies. Never share prescription medicines with others, even if their symptoms look similar.