More than 30 inches difference requires a 36 inch high 'guard'.
Openings in this 'guard' should be small enough to keep a 4" sphere from passing through.
The former US UBC code and present IBC code calls for guard rails to be 42 inches high. This is required for vertical distances from 30 inches to finish grade or higher. I feel a lot better about the 42" number but I still see the 36" / 38"mentioned for railing heights.