I would split optimization into two parts: TTFB (time to first byte) optimization and the frontend optimization.
To optimize TTFB:
Connect your Magento store to a PHP profiler. There are several options, you can google for them.
Inspect the diagram and see if you have find a function call that takes too much time.
Optimize that function call. In 90% case I dealt with the slowness came from a 3rd-party extension.
To optimize the frontend:
Minify and compress JS and CSS. You can turn it on at Stores > Configuration > Advanced > Developer > CSS and JS settings
Serve images in WebP or AVIF formats to cut page weight
Use GZIP compression
Inline critical CSS and JS (critical CSS/JS is what needs to be render above-the-fold content) and lazy load all the rest
Use as few 3rd-party JS libraries/scripts as possible
Remove redundant CSS and JS
Good luck!