Taubah and Repentance

Forgiveness for sins

Q: If we had committed any sin in the past and we are not sure if it was a sin, should we ask any Mufti or Aalim regarding that thing or just repent from all sins and move on in life believing Allah has forgiven us?

Thanking Allah Ta'ala for saving one from committing sins

Q: A person committed some mistake but alhmdullilah, Allah saved him from getting into a big mess. He thanked Allah but he gets thoughts that if he had avoided the mistake, things would have been different, etc. and dwells on his past. He always did some mistakes because of laziness or ignorance but Allah saved him. So, how should he thank Allah but not think of the mistake?