The release notes tell you... https://docs.moodle.org/dev/Moodle_3.4_release_notes. It's really important that you read the release notes before embarking on an upgrade.
"Moodle upgrade: Moodle 3.0 or later (if upgrading from earlier versions, you must upgrade to 3.0.10 as a first step)"
Always have good backups before starting an upgrade!!