That depends on a lot of things. Date mostly - WW1 is fairly well covered, with what survived WW2 bombing. WW2 and later is still held away from public view mostly, unless you can show that you are a close relative (as I understand, anyway).
What you do know - full name, if a common name, it is going to be difficult (how many John Smiths were there in WW1??), Regiment, rank, number - every bit of detail makes it easier.
Where you look - sites like Ancestry have access to some military files, Midlands Historical Data's listings of Birmingham Electoral Rolls have some information in the 'absent voter' content - where an eligible voter was away in the forces in the 1912, sometimes his regiment and number are posted. If you know Regiment name, sometimes they have files you can search, often at their premises rather than online, though.