How to Delete Courses from Education Module

Hi! I just created Courses in Education module and assign them to different instructors. Now i Want to Delete Courses for some reasons but i am not able to do this . I also assgined courses to programs and students also so its getting difficult to delete courses . Is there any way i can delete these courses. Any help will Be Appreciated

Unlink all the linked documents and then delete it. Or you will try to delete in the database but it leads to an error in the future.