Tarjan's algorithm maintains a stack of nodes in the current DFS path and tracks two arrays: disc[v]: Discovery time when node was first visited. low[v]: Minimum of disc[v], low[u] for all children , and disc[w] for all back edges where is on the stack.
When you finish processing node , check if low[v] = disc[v]. If yes, is the root of an SCC. Pop all nodes from stack down to and including . Assign them all the same component ID.