I bought raspberry pi 4 4gb to connect pixhawk.
but I can’t connect raspberry pi with pixhawk.
I don’t think I can help, but nobody really can with such a limited question.
What are you trying to achieve? Should the raspi be a companion computer or something else? What have you tried so far? What were the problems you ran into? etc.
please refer to Communicating with Raspberry Pi via MAVLink — Dev documentation.
steps are same for any RPI board, if you face any problem feel free to reach out.