I start with my methodological thoughts and I offer some footnotes with thoughts that came to my mind on the ethics. Take both of these with a large grain of salt, because we know very little on your specific case. That makes both methodological advice, as well as comments on the ethics difficult and my remarks could completely miss key considerations.
Randomization (either to steroids vs. alternative treatment*, or with respect to delaying immunotherapy**) in theory is your best bet for really establishing causation. If you truly cannot do that, then think about why a prospective study is needed; one reason might be that it's easier to get information on all possible confounders and exposures than in a retrospective design, if so, make sure that you really get this information. Just being able to write "in this prospective study..." in a publication is usually not considered an adequate reason for a prospective study. Alternatives to prospective studies include, for example, retrospective cohorts or case-control studies.
If you do not randomize, you will end up somehow matching patients (either into small groups or strata) or adjusting for confounders in some manner. You may run into some serious difficulties here.
Firstly, it it's about steroids or not, then it might simply be the case that the medical conditions that required steroid treatment lead to a worse prognosis and if nearly all patients with these medical conditions (or most of the ones with the worst severity of the condition) get steroids, there might be no realistic way of adjusting this away, or finding truly matched patients with the same (or equally severe) history that did get and did not get steroids. It might also be the other way around: the worse/the more life-threatening the melanoma, the more prone patients might be to get conditions that require steroids (e.g. due to the melanoma or due to previous treatments for them). Thus, one big question is whether there are alternative treatments instead of steroids that are used for the conditions for which the steroids are used. If there are and if the choice of treatment is based on somewhat random physician preferences, then that's the best situation for a non-randomized study. If there are not, you will have a really hard time (=it may not be possible) disentangling things.
Secondly, when one looks at the time of initiation of immunotherapy (if you have the theory that the longer ago the steroids were used the better), then "longer ago" vs. "more recently" might still be a serious confounding factor (e.g. "more recently" might mean that the patient has not fully recovered and this affects their prognosis) just like what is discussed in the previous paragraph.
* It is always a difficult judgement whether randomization is ethical. In part, whether giving steroids is still ethical will depend on the strength of evidence that is already available. However, if you believe you can still find patients that would get steroids for a prospective study, it seems there is disagreement on this and/or there might be a population where the benefit/risk is still considered acceptable by some physicians. This obviously needs careful consideration, but usually pretty compelling data is needed to truly change clinical practice. Additionally, sometimes the problem might be the other way around - there might be patients where withholding steroids is not ethical.
** Delaying a potentially life-saving cancer therapy in a randomized fashion of course has serious ethical implications, too. Thus, this may not be a good target for intervention, either. The timing could be something to look at in an observational fashion, because one could then have patients with a more similar medical history. However, see second caveat.