The obvious choice would be to use a scroll of identify (or better, learn the spell). Naturally, this requires knowing which scrolls are scrolls of identify, so back to square one.
The sad result of that is that some trial and error is necessary.
Now, there are ways to try things that are safer than others. For that, my best suggestion is use the item on someone else. Sadly this only works for potions, wands and (partially) scrolls. Wands are largely targeted, so simply choose your least favorite monster. Fewer scrolls are targeted, but those that are can likewise target a volunteer. Potions are fun because you get to throw them at your test subject. Of course, this method STILL has the chance to backfire, by using a good effect on a monster. You can choose mostly harmless monsters as your test subjects, but failing that, I still prefer speeding up a monster over the chance of disintegrating myself with my brand new wand.
One last thought, before doing your trial and error, you can try de-cursing the item in question, if possible. Cursed items are almost all bad, so if you can determine that an item is not cursed, dip it in holy water, or (I think this blesses the item?) offer a sacrifice with the item on the altar, before using the item, you're odds of bad things happening go way down.