Need help repairing mac partitions In the process of trying to create a bootcamp partition I messed up my partitions. At this point, I just want to merge the empty 40GB drive with my main one, giving that storage back. Here is what I get when I run a diskutil list. I nuked whatever was on the disk partition beforehand. 

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         202.0 GB   disk0s2
   3:       Microsoft Basic Data OSXRESERVED             8.0 GB     disk0s3
   4:                 Apple_APFS                         40.8 GB    disk0s4

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +202.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            150.7 GB   disk1s1
   2:                APFS Volume Preboot                 44.6 MB    disk1s2
   3:                APFS Volume Recovery                512.4 MB   disk1s3
   4:                APFS Volume VM                      2.1 GB     disk1s4

/dev/disk2 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0: EF57347C-0000-11AA-AA11-00306543ECAC                        *40.8 GB    disk2


To give a little bit more info on my mac:

The macOS partition is working, and I am using it to post this question. The laptop originally only had 1 hard drive, the stock one included in the model. I have included a picture of my system specs below.
In the Disk Utility app, Click the 'Partition' Toolbar button, then in the big pie chart in the revealed tab, click on the partition you want to erase, then click the minus button ('-') at the bottom of the chart. That partition will be deleted, and the other partition will be expanded to to include the newly-emptied space.

If you're doing this by command-line I think you can use the following (based on the diskutil output shown above):

diskutil mergePartitions JHFS+ "Macintosh HD" disk0s2 disk0s4


The third and fourth terms (JHFS+ "Macintosh HD") are actually dummy terms in this context; they are not used. Assuming that disk0s2 — the main partition — is in an expandable format, this should preserve everything in that partition and overwrite the other two. Per the diskutil man page:


  If force is not given, and the first partition has a resizable file
  system (e.g. JHFS+), the file system will be preserved  and grown in a
  data-preserving manner; your format and name parameters are ignored in
  this case. [If] the first partition is not resizable, you are prompted
  if you want to format.