The most straightforward way for making sure your colors work well in all appearances (dark, light, increase contrast, and all the combinations) is to use the provided system colors. Check the background and label semantic colors too.

Grid with colors extracted from Apple’s Human Interface Guidelines showing how each one of the system’s colors, for example systemRed, has variations to better work for default light, default dark, accessibility light and accessibility dark.

All the info in the Color section of Apple’s Human Interface Guidelines: https://developer.apple.com/design/human-interface-guidelines/color