When given percents for an empirical formula problem, first consider all the percents as grams.
58.82% carbon —> 58.82 g carbon
27.45% nitrogen —> 27.45 g nitrogen
13.73% hydrogen —> 13.73 g hydrogen
Then convert the grams of all the elements to moles, based on their molar masses.
Carbon - 58.82 g / 12.01 g/mol = 4.898 mol carbon
Nitrogen - 27.45 g / 14.01 g/mol = 1.959 mol nitrogen
Hydrogen - 13.73 g / 1.008 g/mol = 13.62 mol hydrogen
Then divide all of the mole numbers by the smallest number of moles, which is in this case, the 1.959 mol of nitrogen.
Carbon - 4.898 / 1.959 = 2.5
Nitrogen - 1.959 / 1.959 = 1
Hydrogen - 13.62 / 1.959 = 7
You want whole numbers for all of your mole numbers, so multiply all of them by 2, since 2.5 isn’t a whole number.
Final answer: C5N2H14