How to setup priorities between pipelines that might be triggered simultaneously on Azure DevOps pipelines
It sounds like both of these pipelines are being triggered by the same source commit(s). If that's the case, you should be able to use CI trigger source path filters so that the builds only happen on commits to the relevant code.
If a developer does a single commit that is committing changes to both the main application and the package library (which would still trigger both pipelines regardless of the filter), you should consider promoting better code commit practices. Commits should be generally atomic to an appropriate context (i.e. don't commit to a stand-alone library and an app that consumes it together). Commit [and push if Git] the package changes first so they'll build and publish, then commit [and push] the main application. This will ensure that the trigger filters do what they should.
I don't know of a feature in ADO that allows you to serialize the pipeline execution order in the way you would like. As you suggested, the alternative of triggering one pipeline from another would kind of work but ultimately doesn't solve the core problem.
Alternatively, considering that &quot;project N&quot; changes a lot, and if it has that tight a relationship with the main project. Perhaps consuming it as a package is not appropriate. If the library is also to be consumed by other applications that have a more loose relationship, perhaps consume the dependency directly as code by the main project, but make its package publishing a part of the main application build instead of its own pipeline. (I've used this model for API applications that publish a data contracts library. The API application itself consumes the project directly as a project reference since the two are very tightly related, but others consume as a published package.)