When should I take ibuprofen to relieve pain effectively?

When should I take ibuprofen to relieve pain effectively?