There is no such thing as bad luck in Islam and you should not think of failures in life as bad luck, this is what Allah has decreed. Either this is not a subject that would be of benefit for you to study, or you are not studying the correct way. Not everyone can become an engineer or a doctor!
Each one of us have his own ability and limitations.