In an ideal way; perfectly.
Given ideal circumstances; preferably.
Ideally, we would have one textbook per student, but unfortunately some of you will have to share.