It’s probably worth using your browser to Inspect Element on the page over the element you added this class. You should be able to see how the CSS is being applied there. You may find another class or style is overriding it.
It could be that the background color is overruled by another element's property. You can try to use the important flag for your property:
background-color: red !important;
Can you tell me how to fix it?
hard to understand