For most things it tends to work like this.
Needs to match in voltage. The power supply needs to be able to supply what the device needs or more.
The output can be AC or DC - you want to get this matching. A device made to work on one won't like the other.
The voltage is important as you said. Get it just right. Some devices that you might want to power will have a range of voltages that they are happy enough with. If so it will say. If it just says one voltage, get a power supply with that voltage.
.
The current, A, mA, amperage of the power supply should match or be bigger than the one on the device you want to power.
This one is a little more complicated, but basically, at a fixed voltage, the device being powered will draw, pull, use, a certain current and the power supply needs to be able to supply that, or more. If the device being powered does not need more, it won't draw more.
So a power supply 5volts, DC, 300mA is fine for a device marked 5 volts, DC, 300mA (max).
So a power supply 5volts, DC, 2A is fine for a device marked 5 volts, DC, 300mA (max).
So a power supply 5volts, DC, 1A is NOT fine for a device marked 5 volts, DC, 2A. The power supply will be stressed and fail immediately or later, possibly with heat, flame, destruction of property &c.
Sometimes things are rated by power rather than current (I, mA). Then you can use P = I * V watts = volts times Amps.
Again. voltage match and power supply of greater power capability than the device will draw.
.
Most supplies nowadays are "regulated" meaning that the voltage output is steady, controlled, accurate. Sometimes you get one "unregulated" which means that the voltage will be somewhere near the stated value, or perhaps vary as the load varies. So it makes it a little difficult to judge the voltage match, but he same rules apply, so you don't want a supply that goes higher than the device likes & don't want one that can't supply the current the device needs.
.
Hope it helps. Anything unclear, ask more. People will be happy to help & fill in anything that I left out.