Merge missing disk partition on a Macbook
Linux filesystem partitions may not not appear in the Disk Utility application. I would not recommend using the Disk Utility or diskutil command to remove Linux filesystem or swap partitions. Usually, attempting leads to an unbootable macOS.
I would recommend the following two ways to remove linux partitions.

If your Linux installer flash drive has a bootable live version, then boot to this live version. Most Linux versions include the gdisk command. Use this command to remove the linux partitions.

Boot to macOS Recovery. Basically restart the Mac and hold down the command(⌘)-R key combination. Once booted, open a Terminal application window and use the
 gpt -f remove -i N disk0

command to remove each Linux partition. You need to replace N with the correct partition index. You can use the
 gpt -rf show disk0

command to list the partitions. The Linux partitions have the following partition GUID type values.
 Linux Filesystem          0FC63DAF-8483-4772-8E79-3D69D8477DE4
 Linux LVM                 E6D6D379-F507-44C2-A23C-238F2A3DF928
 Linux Swap                0657FD6D-A4AB-43C4-84E5-0933C84B4F4F