Hint: consider the the set of all subsets of $\{1,2,\dots,n\}$ (of which there are $2^n$) and try to find the total sum of the sizes of the subsets in two different ways. For example, the possible subsets of $\{1,2\}$ are $\{\},\{1\},\{2\},\{1,2\}$. Then adding up the sizes of each subset gives $0+1+1+2 = 4$.
More explicitly, if we add up the sizes of all possible subsets of $[n]=\{1,2,\dots,n\}$, we can either:
$1)$ Note that there are $\binom{n}{i}$ subsets of size $i$ which gives that the total sum of sizes is
$$\sum_{i=1}^{n}\binom{n}{i}i$$
$2)$ Observe that each element is in $2^{n-1}$ subsets, and so contributes $2^{n-1}$ to the total sum. Thus the sum equals
$$n2^{n-1}$$
The value of the sum doesn't change regardless of how we do it, so the expressions must be the same.