Hans Christian Hansen was from Denmark. Family tradition has it that he was in the King’s Personal Guard and a friend. When he joined the Mormon Church there arose great persecution against Hans. The King out of gratitude and compassion for this loyal servant paid his passage to America to keep him and his family safe. Hans was born in Denmark in and is buried in Plain City, Utah. Where do I begin to look for records of his military service?
It would be a good idea to learn about Danish Military Records before beginning a search. A good place to start is the FamilySearch.org Research Wiki article on Denmark Military Records. You didn’t mention the time period involved with your ancestor’s service, but the time period is important because of changes in the military that happened over time. Danish military records were maintained by the national government. Most of these records have been centralized at the Military Archive (Hærens Arkiv) in Copenhagen. The Family History Library has many military records, primarily army and navy rolls for 1788 to 1860. You can also read the article in the Research Wiki on Danish Military Levying Rolls (Lægdsruller).
The Family History Library Catalog lists over 60 items pertaining to various aspects of Danish Military History and records. Look in the Family History Library Catalog under the place name for Denmark. These records have yet to be digitized and will have to be ordered on microfilm.