Ashamed means feeling upset and embarrassed because of a bad action.
He was ashamed when he forgot his teacher’s name.
Example picture