You have two main options: (a) an array environment, and (b) an rcases environment; the latter is provided by the mathtools package. As the following screenshot shows, they produce the same horizontal layout. If you look closely, the line spacing with the rcases option is a bit more generous than it is for array option. The increase in vertical spacing may -- or may not -- be to your liking.
In fact, due to the use of an aligned environment to encase the equations, a third option is available as well: (c) don't use either array or rcases -- \left. \blurb \right\} suffices fully. Many thanks to Donald Arseneau for pointing this out in a comment.

For the case at hand (pun intended), using the rcases environment may be a bit of overkill as the test code doesn't make use of many of the environment's capabilities.
If you need the word "sum" to be typeset in red, be sure to (i) load the xcolor package in the preamble and (ii) change \text{sum} to \text{\color{red}sum}. If the right-hand curly brace also needs to be rendered in red, you can't use the rcases solution ("option B") and you'll need to type \color{red}\right\} and \text{\color{red}sum}.
\documentclass{article}
\usepackage{mathtools} % for 'rcases' environment
\newcommand\blurb{%
% material that's common to all three options:
\begin{aligned}
(a+b)^2 &= a^2 + 2ab + b^2\\
(a-b)^2 &= a^2 - 2ab + b^2
\end{aligned}
}
\begin{document}
\begin{align}
%% Option A: 'array' environment
\left. \begin{array}{@{}c@{}}
\blurb
\end{array} \right}
&\text{sum}
\[1ex]
%% Option B: 'rcases' environment
\begin{rcases}
\blurb
\end{rcases}
&\text{sum}
\[1ex]
%% Option C: no encasing environment
\left.
\blurb
\right}
&\text{sum}
\end{align}
\end{document}
\tizmarklibrary. That will not only help you get his done but also set you up for solving a lot of similar issues. Multiline brackets within a {description} environment is an answer that shows how to solve a similar requirement for a list environment. Even though it is a different environment the idea is the same: place mark at the approraite points on the page that you can later access and do the drawing. – Peter Grill Aug 24 '20 at 04:27\tikzmarkas well, but those won't be usable in as many cases as\tikzmarkwill be and may not be as easy to customize in terms of colors, shading, etc. – Peter Grill Aug 24 '20 at 04:29