The legend of the Lone Ranger in the movies, TV shows, books and comics was based on a Deputy US Marshall named Bass Reeves, a former Union soldier and once-enslaved black man.
Lets take a look at what makes him a legend and most likely the inspiration for the Lone Ranger. Bass Reeves was an expert marksman, he rode a white or gray stallion, was pressed and dressed with a large hat that accentuated his 62 frame unless he was working in disguise. He also carried and handed out silver coins. These coins were used to ingratiate himself to the communities in which he worked collecting bounties. A visit from the real Lone Ranger meant good fortune for the town as he was there to rid it of criminals. He also had a trusted Native American posse man and tracker as a companion. Lastly, many of the outlaws he apprehended ended up at a federal prison in Detroit, which is where the Lone Ranger radio originated in 1933 on WXYZ.
https://recollections.biz/blog/part-3-bass-reeves-the-real-lone-ranger/
One of the first of the deputies hired by Judge Parker's court was a former slave from Texas named Bass Reeves. It is believed that Reeves fought in the Indian Territory during the Civil War with the Union Indian brigades. Reeves was known as an expert with pistol and rifle, stood about six foot, two inches, weighed 180 pounds, and was said to have superhuman strength. Reeves had a reputation throughout the territory for his ability to catch outlaws that other deputies couldn't. He was known to work in disguise in order to get information and affect the arrest of fugitives he wanted to capture.
https://www.nps.gov/fosm/learn/historyculture/bass_reeves.htm
https://www.legendsofamerica.com/we-bassreeves/2/