I get 5-and-a-half-year-olds to sit still for a living. Barring some sort of behavioral or medical issue, it usually isn’t too hard to get a child of that age to sit still for an hour long Mass.
Step One: Fullfill all physical needs ahead of time. Make sure they have ample sleep, are fed, been to the bathroom, noses wiped etc.
Step Two: Remove distractions and temptations. Don’t give them toys, books, food, ipads, etc.
Step Three: Give them something that you actually want them to focus on. For Mass, teach them the songs and responses ahead of time. Tell them what the readings are going to be about. Sit up where they can see the priest and the altar. Outside of Mass time, talk about the icons and images in the church and tell them what they mean. Remind them that they can look at them during Mass and think about the Mysteries. Ask Father if he will give them a “tour” of the altar and tell them what the different things used during Mass are for. Then during Mass, they will understand what’s going on. In the car on the way to Mass, suggest things and people they can pray for in Mass. Assign them a prayer mission!
Step Four: During Mass, continuously assess their needs. Are they getting distracted? Point out something in the church and remind them what it’s for. Have them follow along the words of the Gosple in your missal. Move one to the other side so his brother isn’t a distraction. Remind them to pray for grandma in the hospital.
Step Five: Reinforce good behavior with a reward. My kids like lighting a prayer candle and playing on “Jesus’ playground.”