Which is first ? Tuning the parameters or selecting the model
You can tune parameters only if you have already trained the model, otherwise there is nothing to tune.


  However, i've also read that model selection shoud be done before tuning the parameters.


Before tuning you need to do some kind of pre-processing before tuning the parameters.
Usually your pipeline will consist of:


Get Data and Clean It.
Do some EDA ( Exploritary Data Analysis) do get better understanding of you data.
Do some feature engineering - roughly, if possible, you would like to transform current data, so it would be more suitable for your ML algo.
Train and evaluate your model on validation data.
Tune your model`s params to get better performance ( fight with overfitting alos included).
Evaluate on Test set 



  how are we supposed to do model selection before tuning the parameters 


About Model Selection - I think even without having deep inshights about your data, you can already choose some baseline models (I think its a good rule to start with simple models like Linear Regression or K-NN to get the "feel of the performance"), because in most cases you know that you are probably dealing with regression/classification/clustering task, so you can already specify the set on models to try - but before trying the horde of ML models, you should get your data ready. 

Some posts like this one can give you the feels of available ml algos, but there are a lot more to try. 

In Addition, I think this paper might be very usefull if you are starting to work with ML