To prevent pet obesity, you can ensure your pet gets regular exercise, feed them a balanced diet in appropriate portions, avoid overfeeding or excessive treats, and consult with your veterinarian for guidance on your pet's specific nutritional needs. Additionally, providing mental stimulation and engaging activities can help keep your pet active and maintain a healthy weight.