An accused may be found guilty of an offense necessarily included in the offense charged or of an attempt to commit either the offense charged or an offense necessarily included therein.