simulate this circuit – Schematic created using CircuitLab
Resistance is the load to DC. Impedance is the load to AC.
Any circuit will have two parts; the load and the source. The source supplies power to the load. Any circuit can be simplified down to these components. There is no such thing as a perfect source. With a load applied the voltage of that source will droop. In this Thevenin equivalent circuit, there is a resistor in series with an ideal voltage source to simulate the droop. When more current is drawn from the supply the resistor drops more voltage reducing the available voltage to the load. There is also a Norton equivalent with a current source and a resistor in parallel. This resistor R1, in this case, is the output impedance.
The load then has the input impedance. Simply put, it's the impedance of the load. Regardless of how complicated the load is it can always be simplified down to a single resistor.
The importance of input and output impedance is matching them properly. Suppose a signal passes through a filter and then to an ADC of a microcontroller. The filter, in this case, is the source and the ADC is the load. The sampling of the ADC causes a current draw on the line. This can be simulated by a resistor. This resistor is the input impedance of the ADC. Suppose it is 1k ohm. The filter will also simplify down to a voltage source and a resistor. That resistor is the output impedance of the filter. That resistor is important because it forms a voltage divider with the input impedance of the ADC. If the output impedance is 1k ohm then you get a 50% voltage divider. Any signal that comes out of the filter will be reduced by 50%. Often this level of attenuation is not acceptable.
This could be solved by a buffer stage between the filter and the ADC. The buffer has a very high input impedance and a very low output impedance. Suppose 1M ohm and 10 ohm respectively. The input to the buffer then has an attenuation of less than 1% and the input to the ADC also has an attenuation of less than 1%. Combined that is an attenuation of less than 2% and that is usually acceptable.
The calculation of the Thevenin and Norton equivalents is outside of a standard answer and I will leave it up to you to learn them.