Uriah was one of David’s mighty men, one of his best 37 fighters (2 Samuel 23:8–39 & 1 Chronicles 11:10–47). Uriah, though not a jew, joined David while Saul was still king. Uriah was a hittite, nonetheless, he was obedient, loyal and brave. He fought for David and Israel. However, he had a wife called Bathsheba. One day when Uriah was on the battle field, king David saw Bathsheba from his rooftop while she was bathing in her house and lusted after her. He sent his servants to bring her to him, after which he slept with her. She became pregnant and David tried to cover his sin by killing Uriah.
Read the full account here: 2 Samuel 11.