If you're looking to apply styles to a JavaScript variable, unfortunately, that is not possible. It doesn't make sense to try and achieve such a thing.
It seems more likely that you want to style an html element stored as a variable in JavaScript, like this:
let msgElement = document.getElementById('msg')
let msg = "OK"
msgElement.innerHTML = msg
In this scenario, you can easily add styles to the element like this:
msgElement.style.color = "red"
msgElement.style.border = "2px solid red"
In the example given, when you update the value of `msg` to "Conflict", you are simply changing its content. It's not possible to hold two separate values using the same variable.
As mentioned in some of the comments, this falls under basic web development principles. I recommend further learning through resources like online courses from platforms such as Codeacademy