What is the Formula for Deciding When to Claim?

I am curious about the “formula” to decide when to take Social Security while still working.…