I generally engage my diff lock while moving before I need it. That way teeth are moving & will lock up. Don't engage it when 1 wheel is spinning or it will grind & slam in breaking things as it tries to lock up the spinning wheel to the one with traction. A little motion with both wheels moving is good, a lot with only 1 is bad.
If you are already stuck, try to engage the diff lock. If it goes in, great. If not, bump the go pedal to spin thing internally so gear teeth line up better then try again.