Every palindrome has a center. That center is either a single character (odd-length palindromes like "aba") or a gap between two characters (even-length palindromes like "abba").
Here's the mental shift: instead of checking every possible substring, you treat each index as a potential center and expand outward. At each center, you grow left and right as long as the characters match. The moment they don't match, you stop and record the length.
You do this for both odd and even centers at every position. The longest expansion you find across all centers is your answer.