In real-time wireless control systems, ultra-reliable and low-latency communication (URLLC) is critical for the connection between the remote controller and its control objective. Since both transmission delay and packet loss can lead to control performance loss, our goal is to optimize control performance by jointly considering control and URLLC constraints in this paper. To achieve this goal, we formulate an optimal problem to minimize control cost by optimizing the packet drop and wireless resource allocation. To solve the problem, we analyze the relationship between communication and control. Then, based on the relationship, we decompose the original problem into two subproblems: 1) an optimal packet-drop problem to minimize control cost and 2) an optimal resource allocation problem to minimize communication packet error. Finally, the corresponding solutions for each subproblem can be obtained. Compared with the traditional method only considering the communication aspect, the proposed packet-drop and resource allocation method shows remarkable performance gain in terms of control cost.