To prevent rust, keep your ebike dry by avoiding wet conditions when possible, use a high-quality waterproof cover, regularly clean and lubricate the drivetrain, and store your bike in a cool, dry place.