Whether the door latch is stuck open or closed, you need a way to get your door functioning correctly. There are several possible issues and potential fixes that you can attempt yourself or you can call a professional.
One such issue is a misaligned strike plate. With the door latch stuck only when you are trying to open the closed the door, but not when the door is open, you may have a misaligned strike plate. This could be as a result of moisture expanding the wood, or an issue with the foundation of your home.
What is happening? When you try to retract or extend the latch into the bored hole of the strike plate, the metal latch is not aligning perfectly with the hole which then requires excessive force to have the latch retract against the friction of metal sliding against metal.
Solutions! If the problem is wood expansion, you can consider redoing the finish of your door to keep effects from influencing your door shape. If the issue is your foundation, you may have to explore repair, some form of “rescuing” the foundation, an example may be to remove the tree whose roots are pushing up from under the building.