Resource theories and their applications in quantum thermodynamics and nonlocality