Both options can work, but serum is usually more effective. The thing is, it has a lighter texture and penetrates deeper into the skin, where vitamin C can work better on melanin. Cream mostly works on the surface and also contains more oils, which can clog the spots. But the concentration of the active ingredient matters here - look for at least 10-15% vitamin C on the label, otherwise the effect will be weak. I checked several brands myself when I got spots on my back after a vacation in the Maldives.
The main thing is that vitamin C is unstable, oxidizes quickly and loses its properties. Cheap serums are often already ineffective at the moment of purchase. I recommend getting tested options from well-known brands and paying attention to the release date. You need to store it in a dark place, preferably in the fridge. Apply it better in the morning or evening on clean skin, then definitely SPF during the day - without this the spots can darken even more.
If you want faster results, combine the serum with a cream - apply the serum first, let it absorb for about five minutes, then the cream. Results are usually visible after two or three months of regular use. But if the spots are deep, you might need a dermatologist consultation or even laser resurfacing.