Your friend gave you a pair of underwear that he had ejaculated in? And you went swimming during covid?
While I'm not at all sure why you didn't just go without underwear instead of wearing your friend's dirty, wet underwear, there's no risk here. Once it's exposed to air, any bacteria in the semen would start to die quickly, and by the time you put it on, there would be no risk.
Wherever you are, covid19 is a real thing, and you are at risk. If this is a true story, you need to start social distancing. Covid19 could be worse than any STD you could ever get.