Hey there!
First find the molar mass of C₆H₁₀S.
C: 6 x 12.01 = 72.06
H: 10 x 1.008 = 10.08
S: 1 x 32.065 = 32.065
----------------------------------
114.205 g/mol
Find the percent of the molar mass that is carbon.
72.06 ÷ 114.205 = 0.6310
Multiply that by 29.5.
0.6310 x 29.5 = 18.6
There are 18.6 grams of carbon in 29.5 grams of C₆H₁₀S.
Hope this helps!