First, check your battery for swelling. Symptoms:
— Unexpected trackpad and/or keyboard behavior.
— The gap between the display and the deck is not even when the display is closed.
— The gap between the bottom plate and chassis is uneven in places.
— Some of the screws that hold the bottom plate have popped out.
— The trackpad surface is higher than the surrounding deck surface.
— The computer "rocks" a bit on a known flat surface†.
† I find solid-surface and granite countertops very effective flat test surfaces.
If one or more of those symptoms exists, get Apple to evaluate as soon as possible. Sweling can get worse overnight, exerting enough force to irreparably damage internal components or enve the metal chassis of upper deck.
If there are no symptoms of a failing battery, then try an SMC reset. Please see:
Reset the SMC of your Mac - Apple Support
being careful to use the instruction set under the heading "Mac with Apple Silicon."
Beyond that, you'll need professional evaluation.