I am new to R, I found the theoretical answer but need to learn how to use R for simulation.
Question: Consider tossing three fair coins. Define X as the random variable "number of heads showing when three coins are tossed." Simulate tossing three coins 10,000 times in R. Compute the simulated mean and variance of X.
Thanks for answers.

Let $Y_i \sim$ Bernoulli$(p)$, with $p\in(0,1)$ for $i = \{1,2,3\}$.
Then $X = \mathbb{1}_{\{Y_1 = 1\}} + \mathbb{1}_{\{Y_2 = 1\}} + \mathbb{1}_{\{Y_2 = 1\}}$ is the number of heads (success) in three coin tosses.
We have that $EX = 3p$ and $VX = 3p(1-p) = 3(p-p^2)$, if the coin is fair then $p=\frac{1}{2}$ and $EX = 1.5$ and $VX = 0.75$.
This can be simulated in R like this:
Things are quicker if you know that the sum of Berloulli random variables (coin tosses) is a binomial variable, as others have stated.