When we develop a web part, we definitely face errors, but this error may be prevent you from loading the page and all you can see is an error! Helpful I know!
Anyway the problem is want to remove the web part from the page, but we can’t even edit the page at all.
Add to the URL this QueryString ?Contents=1
You will then see the page as below: now you can close or delete the bad web part.
I haven’t specified the SharePoint version is it works from SharePoint 2007 .. 2010 & 2013 but not sure about more previous versions but who still uses it anyway !
Hope that helps.