First and foremost never go towards the forest on foot or in a vehicle if it is prohibited. There are gates from where all tourists vehicles enter. Use only the authorised gates to enter at the given time with a valid permit to enter the park. Do not even try entering from any other area in the protected areas. There are many precautions to take while staying near a national park. Some are listed below.
Caught in a national park without a valid permit will attract a jail term for you besides impounding of your vehicle. So please do not even think on these lines even if any local or a resort person tells you to.
Never leave the vicinity of the resort by yourself after sunset. Not even if you plan to just take a stroll around after your dinner. After sunset Leopards often tend to come close to the villages and resorts in search of food or the livestock. Tigers also move around in the night outside the protected areas. It is not worth the risk or adventure that you might want to experience.
If you go out for some emergency work, and you must cross the buffer area of the forest, please do not go on a two wheeler. Ensure you are in a car and take someone along from the resort who knows the area, and do not forget to carry a torch for sure. Driving a two wheeler in a forested area is a huge risk more in the night. If it breaks down, or a flat tyre, you can be in for a tough time. Four wheeler will at-least ensure your safety from the predators.
But if you happen to be in the Elephant country, then even a four wheeler is not a good idea to travel in the night. It is best that you postpone all your work for next day morning. Wild Elephants can treat your vehicle like a football. Hence it is in your best interest to stay in safe vicinity of your rooms.