There are a few things you can do to prevent rice from sticking to the pan when cooking. First, rinse the rice until the water runs clear to remove excess starch that can increase stickiness. Additionally, using a non-stick pan and adding sufficient oil before frying can help prevent sticking, as can adding more oil as needed. Finally, it's important to wait until the oil is hot before adding the rice to the pan to prevent it from absorbing the oil and sticking.