Go by the expiration date printed on the package. For most OTC medicines, opening the container doesn't start a shorter countdown — storage is what actually shortens a medicine's life.
Yes — Antibiotic ointment (Neosporin, bacitracin) carries a printed expiration date and that's the date to go by. Use by the printed expiration date. Heat is the real problem for ointments — a tube that's been through a hot car can separate and lose potency well before its date. Squeeze from the bottom, cap it tightly, and don't touch the nozzle to a wound. Not medical advice — for a wound that looks infected, see a clinician rather than reaching for an old tube.
Room temperature 68–77°F (20–25°C), capped, away from heat — don't leave it in a car or a first-aid kit in the garage. Heat and humidity shorten a medicine's real life faster than the printed date suggests, which is why a bathroom cabinet is the worst place for it.
Throw it out if you notice: Separation into oil and solids; Discoloration or a grainy texture; A rancid or changed smell; Past the printed expiration date. Not medical advice — ask a pharmacist if you're unsure.