Optimal stopping problems and their applications