Introduction to TensorFlow -> tf.Session() is deprecated

tf.Session() is depracated, how do I fix this in my code?

you can fix it by using tf.compat.v1.Session() instead of tf.Session()
TensorFlow v2.14.0