Program to check whether a string is accepted by an unrestricted grammar
Unfortunately, you cannot. 

Nobody can since the membership problem for unrestricted grammar is undecidable. Here is a reference in Wikipedia.

On the other hand, the membership problem for context-sensitive grammar or, what is equivalent, noncontracting grammar is decidable. 1

Just in case it is not clear to you, a collection of decision problems (a.k.a, yes/no questions) is decidable if there is a program which will solve any given one of them correctly within finitely many steps. It is undecidable if there is not such a program. 
The existence of undecidable problems could be the best technical backdrop for this story.

You will learn its formal definition in your study of computer science (or you might have). There will be lots of undecidable problems coming to you; so if you suspect one, you should probably wait until you have studied the chapter about undecidability and somewhat more before you raise a similar question. Or you could just search around using the keyword "decidable" or "undecidable"