There are a few solutions. The first way is to line your square pan with parchment paper. Alternatively, you can spray the pan with a little cooking spray. Alternatively, you could also grease the pan with unsalted butter.