The same stock bought back is the obvious case. Buying a call option on the stock you just sold at a loss, or a convertible bond convertible into it, can also count because the rule reaches contracts and options to acquire substantially identical securities.
Ordinary and preferred shares of the same issuer are usually not substantially identical unless the preferred is convertible and trades in lockstep. Two different index funds tracking different indices are generally treated as distinct, while two funds tracking the same index are a grey area many advisers avoid.
The IRS has never published a bright-line list, which is why conservative practice is to switch to a clearly different exposure for 31 days rather than argue about closeness.
General information for the United States only, not tax advice. Rules change and depend on your circumstances; get professional advice before acting.
Related: wash-sale-rule, wash-sale-61-day-window, call-option, etf, superficial-loss-rule