Example 2 Solve the equation $2^{x}=x+1$.

Translate the text above into English, please retain the original text's line breaks and format, and output the translation result directly.
Solving, we observe that $x=0$ or 1.
Let $y=2^{x}, y=x+1$, plotting the graphs yields two intersection points $(0,1)(1,2)$. Therefore, the roots of the equation are $x=$ 0 or 1.