I installed ubuntu and linux mint into my mac. I want to remove it because I gave it too less space. Now, I don't know what to do now.
You could burn a live CD with Ubuntu or Mint or prepare yourself an Ubuntu USB stick to load it from there. Then you repartition your hard disk drive using gparted from within the live CD and re-install or remove it.
To prepare a live CD, just download the Ubuntu version you want to install from www.ubuntu.com and then burn it by double-clicking the ISO. If you do not have a cd burner, prepare a USB stick.
To do this, you want to use the Ubuntu "Startup Disk Creator", it can be found in synaptic but should be pre-installed on Ubuntu.
Then simply boot from your device. When restarting your machine, you might need to press the key needed to get you into the selection menu where you can choose what device you want to boot from. On my Dell XPS it's F12, but it should show on startup what key you need to press to load from the boot media.
Note that since you are using a Mac, you cannot stably boot from a USB stick. I know this from research and past experiences. Therefore, definitely use the live CD to boot your computer. To boot from the CD, hold down the alt/option button as you turn the computer on. If the live CD is not already inserted, then do so when the list of boot options appear. Then select to boot from the CD. On my Mac, three images appear at the boot screen: an image of a hard disk, and two images of a CD. The image of the hard disk and one of the images of the CD has "Windows" written below it. The other image of the CD has EFI written below. Select to boot from the CD labeled "Windows." Once you have booted your computer with the live CD, use either the disk utility program to erase any Linux partitions on your machine (except for the swap partition). I typically use disk utility; however, I have been told that GParted is another excellent option for removing partitions from the disk. I only use GParted for manually resizing disk partitions. Please remember to backup any data before using either program to erase the disk. Hope this helps.