I am with Nacho45 and others who counsel prudence. I am not sure if dropping a class, taking a failing grade, in preference of an unnecessary 2nd job that interests you is a sin or not. But if a sin, it seems it would been venial and not mortal.
But look deeper at your choice. You made a commitment to that class. Now you are tempted to dishonor that commitment because something better came up that just cannot wait. An adult should always put a high value on giving his or her word. Keeping your word builds character. Breaking your word for personal convenience shows your character is not yet as strong as it needs to be to face greater challenges in the future.
I don’t know the situation, but quite often, one or more students could not get into a class you did because it was full. You got in, someone did not. You drop it and that someone still did not get in. He or she suffers. It could happen again when you take the course or substitute course later. So, it is possible you unintentionally hurt someone else. Perhaps twice.
Again, I do not know the situation, but experience teaches me - I am now retired and looking back - that quite often God provides a small window of opportunity to prepare for our life’s work or at least the next chapter of our life. We seldom get another chance to do what we had the chance, but chose to pass it by.
Yet, there are times when a sudden change in course opens up an entirely new and better direction. Or worse. But that is usually not knowable when the you take the change.
But, in general, it is usually the wiser path to honor one’s commitment.