This is really vague, I'm afraid.
I read it at least forty years ago, my memory says novella but it could have been a full book back in those days.
What I recall: A war is ongoing, I think on another world but it could be Earth. Futuristic weapons such as laser rifles and the good old sci fi fave 'blasters' are used. For some reason the battles are in trenches like WW1.
A key part of the story were 'cling-mines'. Once the wire is tripped these things cruise slowly about three feet in the air and are programmed to track body heat. Then they hook into the middle of your back - they explode if you try to remove and they explode anyway after a random number of minutes.
Descriptions of battles and charges. Here and there, on both sides, there are scenes with scattered men walking grimly towards the enemy. They have been cling-mined and are striving to take some opponents with them at boom boom time.
I think one of the main protagonists gets caught by one and calls a hasty farewell as he marches away from his comrades. I think he was praying for an enemy bullet so he wouldn't shame himself by shrieking in terror.
Edit:- This story has now been identified (thank you Winchell Chung!) and I was mistaken about 'Cling-mines' ... They were in fact called Chase Bombs