Before you attempt to modify the partitions, make sure you have a good backup of the data in the other partition you want to keep. Modifying partitions is very risky.
Within Disk Utility click "View" and select "Show All Devices" so that the physical drive and hidden Container appears on the left pane of Disk Utility. Click on the physical drive, then on the "Partition" tab. See if you can delete the one partition and see if there is an option to merge them together. FYI, you can only merge the second partition into the first one. I don't believe you can merge the first partition into the second one.
Sometimes it just is not possible to merge partitions back together. In those cases you will need to erase the whole physical drive and restore the data from a backup or from a temporary storage location.
This is why I strongly discourage people from using multiple partitions.
You should always have frequent and regular backups of your computer and all external media which contains important and unique data.