Charge your phone for an hour. Leave it plugged in. Then:
- Press and quickly release VOLUME UP
then
- Press and quickly release VOLUME DOWN
then
- Hold the SIDE button until an Apple logo appears (15-30 seconds), ignoring "slide to power off" if it appears
The operative word here is QUICKLY; and try it a couple of times, the timing is a little tricky. If done correctly this will always work unless the phone has a hardware problem.
When it comes back on log in, then go to Settings/Battery/Battery Health… and see what it says, and what your maximum capacity is.