Separation of variables is a standard way of solving simple partial differential equations in simple regions. In general, the boundaries will have to be at constant values of the coordinates. In Cartesian coordinates, that works out to rectangles. Using cylindrical or polar coordinates, or similar, allows somewhat more general regions.
The idea is to write the solution as an infinite sum of chosen functions of one coordinate times coefficients that depend on the other coordinate(s). How exactly this works will be demonstrated by example.