The second way is correct

Think of it this way: All content should be in the HTML, and grouped logically with base elements like divs, lists, paragraphs, etc. All things that specifically affect the style should be in your stylesheet.
That's why people don't use <b>bold</b> tags anymore, because 'bold' is a style that should be in the CSS. So instead, we use <strong>strong tags</strong>. They're bold by default and work just like <b>bold tags</b>, but strong doesn't
mean bold. It just means "strong" words should have more emphasis. Imagine if you just wanted to turn those words red instead of bold. This makes sense:
strong {
font-weight: normal;
color: #f00;
}
Strong words are normal weight and red. Cool. But imagine applying that to a bold tag instead of the strong tag. Now the "bold" tag is .. not bold? Sure, it'll
work, but it's counterintuitive and semantically very wrong.
It may seem nit-picky, but that's the level we go to in order to keep styling completely separate from the HTML

. So yeah, inline styles are a big no-no. Only as a very VERY last resort, in the cases where you may not have full control over the stylesheet.