You can use 12 2 wire for 220 volts or 240 volts if the amperage is 20 amps or less.
If the amperage is over 20 amps you should use 10 gauge wire or above if the amperage is higher.
12/2 wire can be used for 220 volt to 240 volt "unless the amperage is higher than 20 amp" using the white wire as a conductor instead of a neutral.
Simply remove it from the neutral bar, tape it black, and connect it to a 2 pole breaker along with the black wire.
220 volts and 240 volts draw less amps than 110 volts or 120 volts instead of drawing more amps "because as the voltage increases, the amperage decreases proportionally to maintain the same wattage" which uses a double pole breaker with 110 volts to 120 volts on each side which equals to the 220 volts to 240 volts needed.
The reason you would use a double pole breaker is if you're installing a circuit that requires 240 volts such as your main breaker or a breaker for a clothes dryer, 240 volt baseboard or other electric heaters, water heater, pool heater etc.
The 240 volt double pole breaker outputs 120 volts on each side from the breaker panel which equals the 240 volts needed.
240 volts draw less amps than 120 volts.
For the same amount of power, a 240 volt circuit will draw less amps than a 120 volt circuit, because when the voltage increases, the amperage decreases proportionally to maintain the same wattage.
Double pole breakers are 240 volts with 120 volts on each side that make up the 240 volts.
The size of wire that you need for a 30 amp breaker is 10 gauge wire also known as 10 AWG wire.
The size wire that you need for a 40 amp breaker is a size 8 AWG which is an 8 gauge wire.
8 AWG wire is the standard wire size for electrical circuits that are on a 40 amp circuit breaker.
The gauge number of a wire indicates its thickness, with lower numbers representing thicker wires that can carry more current.
10 AWG wires and 12 AWG wires are not suitable for 40-amp circuit breakers.
10 AWG and 12 AWG copper wires have 35 Amp and 25 Amp wire ampacity.
Using the 10 AWG or 12 AWG for a 40 Amp circuit is inherently wrong and might result in an electric accident.
A 20-amp 240-volt circuit calls for 12-gauge wire.
A 30-amp circuit calls for 10-gauge wire.
A 40-amp circuit calls for 8-gauge wire.
And a 50-amp circuit calls for 6-gauge wire.