On top of Winston63's advice, I avoid sweets or dark chocolate desserts past 7.
If the sugar doesn't affect me, the slight bit of caffeine in the chocolate will.
They made THC gummies legal in my state, so a 5mg one about an hour before bedtime helps.
About 500mg of magnesium relaxes my legs, too, and helps me avoid calf cramps.
Some simple stretching well before bed helps me, as well.