In general, unholy water is only useful for making cursed objects. An exception might be for intentionally healing a demon, undead, or lycanthrope, such as a pet, or a chaoticplayer. Although the vast majority of objects in the game are better when they are not cursed, there are some exceptions to this rule, and it is these exceptions that are of interest here.

Cursed scrolls of gold detection can detect traps or magic portals. Note you can also get this effect from confused non-cursed gold detection, and the traps will not show up as gold.

Cursed scrolls of enchant armor or scrolls of enchant weapon can lower the enchantment level of armor or weapons. This is occasionally useful if you want to (for example) raise a weapon's enchantment from +6 to +7, since the only safe way to do so requires first lowering the enchantment to +5. However, in most cases the best way to lower enchantments is to use #engraving or drain life.

Pets will not pick up cursed items and will avoid walking over squares containing cursed items. A stack of darts, arrows, or rocks can be cursed and used to activate many Elbereth squares without the risk of a pet picking up the item or smudging the engraving. This can also be used to temporarily block your pet from entering an area, e.g. to prevent a strong pet from attacking a shopkeeper or priest you want to keep alive. If only a single square needs to be blocked off then the potion of unholy water itself can be used.

A cursed unicorn horn is an unlimited (albeit dangerous) source of confusion for illiterates and speed runners. Forgotten spells are better for everyone else.

One way is to grab it from a bones pile: it is likely that water dropped from a previous player will be cursed, and thus unholy. Bones containing dead priest(esse)s are especially good sources, as their starting potions of holy water might have become unholy.

With that first potion, it is easy to make more unholy water by dipping a stack of a few uncursed potions of water into unholy water.

Praying at an altar not of your alignment with potions of water on the altar is another method to make unholy water, but this will anger your god with the usual consequences. You can offset the anger point in a number of ways, such as by sacrificing a former pet on the cross-aligned altar (this neither converts the altar nor consumes the corpse nor angers a tending priest, but has its own disadvantages), but you will still have suffered the loss of any divine protection in addition to the harmful effects being smitten.

The safest way is to read a blessed scroll of remove curse while confused, which has a 25% chance to either bless or curse the uncursed items in your inventory, and hope that this curses some potions of water. To avoid accidentally cursing useful items, either drop all uncursed items you do not wish to make cursed or read a second blessed scroll of remove curse after dropping all unholy water. To increase your chances of getting unholy water, have many potions of water and individual-name each one with a different name so that they don't stack. This method has the added benefit of potentially created holy water, which is also useful.

Unlike most cursed potions, dipping unholy water will not cause it to dilute and lose its cursed status (becoming an ordinary potion of water). Cancellation will result in uncursed potion(s) of water, as will dipping a stack of unholy water into a potion of holy water (but this consumes the holy water).