I found many WW1 records on my Grandad’s time as a soldier via Ancestry.co.uk (as mentioned by TomH) including his medical records. It’s a paid for service but has a free trial period. I’d suggest gathering as much info on your family as possible before starting the trial to maximise its usefulness.
I was lucky in that I had access to my Grandad’s ‘little Soldier’s Book’ which gave me various details including his regiment and army number but I suspect you could still find records without this information.
This doesn’t directly answer your question but if you are able to gather a number of military records, you might find it useful to do what I did. As I mentioned above, I found a load of military records for my grandad but a pile of random, unrelated records were confusing and difficult to make sense of. So, I decided to add them all into timeline software so I could see them in context.
It turned out to be a good decision and worth the effort of manually typing them in. Suddenly, I could see all the events in context and follow the story of my Grandad’s time during WW1.
I happened to use xtimeline at the time but would probably use Aeon Timeline if I was doing it now but any timeline software would do.