Mission problem with pixhawk4

I use pixhawk4 for a quadcopter and when I try to assign a mission it doesn’t do it and takeoff to sky like a rocket and try to go somewhere else. And when I connect to QGroundControl again mission doesn’t show up. how do I fix this?

Are you using PX4 or ArduPilot?