sed by default only operates on a line-by-line basis.
To match across lines - as it appears you are using GNU sed - you need to use -z option (it will slurp the file contents and sed will be able to "see" line breaks) and then use . to match any char (in POSIX regex, . matches even line breaks). Note [\s\S] is a "corrupt" POSIX pattern, as inside POSIX bracket expressions, PCRE-like shorthand character classes are parsed as combinations of a backslash and a char next to it (i.e. [\s] matches a \ or s).
Another issue is that you used single quotation marks inside single quoted string, which is wrong (they got stripped in the end and your pattern had no ' in it).
So, with GNU sed use
sed -i.bak -z "s/.*<h1 class='test'>//g" 36
With a non-GNU sed, you could use techinques described here.
//g" 36`
– Wiktor Stribiżew Nov 05 '21 at 08:16