Let me explain this rule by taking examples
27^2 = (27+3)*(27-3) + 3^2 = 30*24 + 9 = 720+9 = 729
In this method, we have to make a number ending with 0, that's why; we add 3 to 27.
Example.
Understand the rule by 1 more example
78^2 = (78+2)*(78-2) + 2^2 = 80*76 + 4 = 6080+4 = 6084