One loop: O(n). Two nested loops: O(n²). Halving each step: O(log n). Sorting: O(n log n). Checking all subsets: O(2^n).
If you see recursion, draw the call tree. Count the levels and work per level. Multiply them.
Constants and lower terms do not matter for Big O, but they matter in practice. O(n) with a constant of 1000 can be slower than O(n log n) with a constant of 1.