#To sove it just I used this
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator # Use AerSimulator instead of Aer
from qiskit.visualization import plot_histogram
import matplotlib.pyplot as plt
# Define a simple quantum circuit
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
# Use the updated AerSimulator
simulator = AerSimulator()
# Run the circuit
result = simulator.run(qc, shots=1000).result()
counts = result.get_counts()
# Display results
print("Measurement results:", counts)
plot_histogram(counts)
plt.show()